How to pass GET parameters to rewritten URL?
- by Jakobud
I have an .htaccess rewrite rule like this:
RewriteCond %{SCRIPT_FILENME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^search/(.*)$ search.php?q=$1
What this does is, if someone visits http://www.mysite.com/search/test the URI that is really processed is http://www.mysite.com/search.php?q=test.
Now, if I try to pass an extra random GET parameter to my rewritten URL, the parameter is ignored. So if I try to do visit here:
http://www.mysite.com/search/whatever?extra=true
The parameter extra is ignored. It doesn't seem to get passed at all.
Can this problem be fixed? If so, how?