Forum Moderators: phranque
RewriteEngine on
RewriteRule ^activation/?$ /activation.php [NC,L]
When opening example.com/activation it renders the page OK, but when trying to access example.com/activation?msg=1 or any other querystring the browser throws a 404 - Not Found message.
Im kind of desperate. Why does it throw an error? Thanks.
[edited by: jdMorgan at 1:24 pm (utc) on April 4, 2008]
[edit reason] example.com [/edit]
By default, mod_rewrite passes a query string without modification unless you explicitly change the query string. So, if you've got mod_rewrite working at all, then your code should work.
An issue that comes up all the time is this: Did you completely flush your browser cache before testing? You've got to do this after any code change, in order to avoid seeing stale results cached by your browser. This may in fact be by "example.com/activation" works, and the other URLs don't.
Or, it's possible that your script is throwing the error.
In these cases, it's often useful to take a step back and try a dirt-simple rule:
RewriteRule ^foo\.html$ http://www.google.com/ [R=302,L]
Jim