Reputation: 507
I am trying to 301 redirect a query string to another query string, but everything I am trying seems to be failing.
I am trying to accomplish this:
http://www.example.com/something?_dog to redirect to http://www.example.com/something?_cat http://www.example.com/page1?_dog to redirect to http://www.example.com/page1?_cat http://www.example.com/aboutus?_dog to redirect to http://www.example.com/aboutus?_cat
and thousands of other pages, so i need to keep the current url/directory etc but just redirect it to use a different query string. they will all be "?_dog" going to "?_cat"
any help much appreciated
Upvotes: 1
Views: 60
Reputation: 785156
You can use this code in your DOCUMENT_ROOT/.htaccess
file:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^_dog$ [NC]
RewriteRule ^ %{REQUEST_URI}?_cat [L,R=302]
Upvotes: 1