Hi folks,
I have a situation that's most easily explained via example, I think. So here goes. Let's say I have the following URLs:
- /page.asp?id=123
- /page.asp?id=123&category=ABC
- /page.asp?id=123&category=ABC&var3=X&var4=Y
I need these pages redirected. Currently links 1, and 2 redirect correctly. Option 3 though can have an arbitrary number of other parameters with arbitrary values. What I need to do is, for page.asp, ignore all parameters aside from id and category. Is there a way to do this with rewrite rules? If not, would it be possible to do if I did have the names of the other parameters?
Not sure it helps, but here is what I have so far. unwanted_var_name
and value
are replacing specific param and value that we're presently using to bulk redirect anything with that parameter... however this isn't ideal:
RewriteCond %{QUERY_STRING} unwanted_var_name=value
RewriteRule .*$ http://www.domain.com? [R,L]
Thanks,
EF