Forum Moderators: phranque
I'm relatively new to modifying .htaccess files. What I'm trying to do is use RewriteRule to clean up the URLs from query strings. Here's part of what I have:
RewriteEngine on
RewriteRule ^([_0-9a-z-\.]+)$ /$1/ [NC,R]
RewriteRule ^([_0-9a-z-\.]+)/$ index.php?v1=$1
RewriteRule ^([_0-9a-z-\.]+)/([_0-9a-z-\.]+)/$ index.php?$1=$2 [NC]
RewriteRule ^([_0-9a-z-\.]+)/([_0-9a-z-\.]+)/([_0-9a-z-\.\@]+)/$ index.php?v1=$1\&v2=$2\&v3=$3 [NC]
RewriteRule ^([_0-9a-z-\.]+)/([_0-9a-z-\.]+)/([_0-9a-z-\.\@]+)/([_0-9a-z-\.\@]+)/$ index.php?v1=$1\&v2=$2\&v3=$3\&v4=$4 [NC]
I also have the following conditions before each rule (leaving them all in would have been redundant for this purpose):
RewriteCond %{SCRIPT_FILENAME}!-f
RewriteCond %{SCRIPT_FILENAME}!-d
Now, this works on my local machine, Windows+Apache 2.0.55, but not on my hosting account, Linux+Apache 1.3.37. I get a "500 Internal Server Error". Does anyone see a problem with any of the above code?
Oh, and so you know, I'm escaping the '.' and '@' in the last couple of rules for a reason: I'm passing email addresses for those variables.
Any and all help/input is greatly appreciated.
Good eye, phranque, but the [NC] specifies that it is case-insensitive. Thanks for the effort.