Trying to redirect:
/category/unique-name?foo=123&bar=&abc=
to:
http://www.example.com/new/page
The majority of the articles I've read hint towards redirecting a query string pattern for multiple pages. I'm just after the one page that needs a redirect.
My latest attempt looks like this:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/category/unique-name/$
RewriteCond %{QUERY_STRING} ^foo=123&bar=&abc=$
RewriteRule ^(.*) $ http://www.example.com/new/page? [R=301,L]
Any help greatly appreciated!
UPDATE 07/04/2017
Thanks for all of the suggestions. I've tried them all, some resulted in an Error 500, some had no effect. I've listed which are which below...
# NO CHANGE
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/category/unique-name$
RewriteCond %{QUERY_STRING} ^foo=123&bar=&abc=$
RewriteRule ^ http://www.example.com/new/page [R=301,L]
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/category/unique-name$
RewriteCond %{QUERY_STRING} ^foo=123&bar=&abc=$
RewriteRule ^ http://www.example.com/new/page [R=301,L]
# ERROR 500
RewriteEngine On
RewriteCond %{QUERY_STRING} ^foo=123&bar=&abc=$
RewriteRule ^/?category/unique-name/?$ $ http://www.example.com/new/page? [R=301,L]
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/category/unique-name/?$
RewriteCond %{QUERY_STRING} ^foo=123&bar=&abc=$
RewriteRule ^ $ http://www.example.com/new/page [R=301,END,QSD]
RewriteEngine On
RewriteCond %{QUERY_STRING} ^foo=123&bar=&abc=$
RewriteRule ^/?category/unique-name/?$ $ http://www.example.com/new/page [R=301,END,QSD]