How to redirect URLs based on query string?

neither Redirect nor RedirectMatch allow you to specify a query string for the redirect source.
[Source]

You have to use mod-rewrite for redirecting based on query string:

RewriteCond %{QUERY_STRING}  ^p=375$
RewriteRule (.*)  http://www.example.org/content/MyNewPage?  [R=301,L]

Leave a Comment