0

There is somehow a error with my .htaccess file:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME}.php -f  
RewriteRule ^([^\.]+)$ $1.php [NC]
RewriteCond %{REQUEST_FILENAME} >""
RewriteRule ^([^\.]+)$ profile.php?user=$1 [L]</pre>

yet I do not know what is wrong!

I am trying to make a permalink connector. So if a user enter "localhost/postin'/profiles/username_here" it will redirect them to a URL similar to this "localhost/postin'/profiles/profile.php?user=username_here"

The error it is producing is:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

3
  • 2
    You need to give us a bit more information. What is the error? What is not happening that you expect to happen? Commented Jan 14, 2015 at 23:28
  • Well, what is this RewriteCond %{REQUEST_FILENAME} &gt;"" and also why do you have a pre tag at the end? Commented Jan 14, 2015 at 23:54
  • To be honest I do not get .htaccess files at all, and I got this example off of the internet. Now I have been doing a little more testing and such, and it looks like the error lies in the last line; RewriteRule ^([^\.]+)$ profile.php?user=$1 [L]</pre> Commented Jan 14, 2015 at 23:59

1 Answer 1

2

Replace your rules and try this instead.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^profiles/([^/]+)/?$ /profiles/profile.php?user=$1 [L,QSA]
Sign up to request clarification or add additional context in comments.

2 Comments

Hello, I tested this, and it does not do anything. Normally it would atleast test the URL, this time it is not doing anything with it :( It is just saying the URLs I am entering do not exist.
Where is your .htaccess file and what is your document root?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.