Forum Moderators: phranque

Message Too Old, No Replies

.htaccess 500 error

htacess, 500, error

         

zilvernex

9:08 pm on Dec 12, 2008 (gmt 0)

10+ Year Member



Hello, I'm new to htaccess and I'm getting a 500 error when trying to use this code..


RewriteEngine On
RewriteRule ^([^/]*)$ /?pg=cat&type=$1 [L]

I want to change my URL from..

[mywebsite.com...]

to

[mywebsite.com...]

Thank you in advance for any help.

jdMorgan

9:48 pm on Dec 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It could be that mod_rewrite isn't allowed, because you didn't enable SymLinks, which is required. Or it could be the fact that your code allows rewriting "/" to itself, so it loops.

Look at your server error log to determine which is the specific problem. In either case, the changes below should fix it.


Options +FollowSymLinks
RewriteEngine on
RewriteRule ^([^/]+)$ /?pg=cat&type=$1 [L]

Be aware that the function of this code is to deliver a request for the URL "example.com/xyz" to the file defined as the DirectoryIndex at "/" with an appended query string of "xyz". This will not change the links on your pages, and you must modify your script (or use a plug-in if this is a commercial script) to change those links.

Jim