I've searched for this but the answers I've found seem to be around rewriting URLs or for redirecting lots of pages in an entire section and look confusing (lots of regex).
We need to add some 301 redirects and everything is working fine except for 13 URLs that contain query strings.
Is there a trick to redirecting these kinds of urls?
Redirect 301 /blogsearch/?akID%5B30%5D%5BatSelectOptionID%5D%5B%5D=39 /blogsearch/Coffee
Redirect 301 /blogsearch/?akID%5B30%5D%5BatSelectOptionID%5D%5B%5D=26 /blogsearch/Food
Redirect 301 /blogsearch/?akID%5B30%5D%5BatSelectOptionID%5D%5B%5D=27 /blogsearch/Wine
Redirect 301 /blogsearch/?akID%5B30%5D%5BatSelectOptionID%5D%5B%5D=29 /blogsearch/Travel
Redirect 301 /blogsearch/?akID%5B30%5D%5BatSelectOptionID%5D%5B%5D=37 /blogsearch/Hotel
Redirect 301 /blogsearch/?akID%5B30%5D%5BatSelectOptionID%5D%5B%5D=49 /blogsearch/Apartments
Any help would be much appreciated.
Cheers
Ben
Yes there's a trick. You can't use
Redirect
directive with query strings.You could just do something like this with
mod-rewrite
. Just change the corresponding query string value for every individual link you have.