: How to pass GET parameters to rewritten URL? I have an .htaccess rewrite rule like this: RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^search/(.*)$ search.php?q=
I have an .htaccess rewrite rule like this:
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^search/(.*)$ search.php?q=
What this does is, if someone visits example.com/search/test the URI that is really processed is www.example.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:
www.example.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?
More posts by @Bethany197
1 Comments
Sorted by latest first Latest Oldest Best
You are looking for the Query String Append flag - e.g.
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^search/(.*)$ search.php?q= [QSA]
See the mod_rewrite documentation for a full description of RewriteRule flags.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.