I’m having a strange issue on my Mac OS X (10.8) dev computer. I configured mod_rewrite to be on and it does seem to work in certain situations. I have one test rule right now that I’m trying to make work but it just won’t, unless I change the rule to do something I don’t want.
Here’s the rule:
RewriteRule ^driver/([0-9]+)$ driver.php?d=$1 [L]
Now, if I attempt to call driver/411. What apache appears to be doing is calling driver.php with no GET parameters and ignoring the .htaccess rules altogether. I know this to be true because this rule with a hardcoded value also fails:
RewriteRule ^driver/([0-9]+)$ driver.php?d=411 [L]
However, if I replace the prefix I’m looking for to not match the file name prefix, it works:
RewriteRule ^driverz/([0-9]+)$ driver.php?d=$1 [L]
Does anyone know how I go about telling apache to not do this behavior?
This is because MultiViews internally redirect to driver.php, before mod_rewrite get’s applied. So there will be no GET parameters.
Disable MultiViews by adding the following to your htaccess:
(PS Apache should disable this by default. Who uses MultiViews anyways)