How can I redirect an old search link, which has been indexed or bookmarked, to a particular page in Miva? I have tried the a redirect 301 in .htaccess but it doesn't work. It just does a search. Suggestions?
Redirect an old search link to a page
Collapse
X
-
-
Re: Redirect an old search link to a page
If the part of the URL you're trying to redirect is contained in a query string, you need to use a rewrite rule. Can you post the old link (minus domain name) and the new link with or without domain?
-
Re: Redirect an old search link to a page
Hi David,
Thanks the link does contain a query string. See example.
Redirect 301 /Merchant2/merchant.mvc?Screen=SRCH&Store_Code=AE&searchcatco unt=1&srch_author=1&Search=Alan%20Questel /Author-Alan-Questel.html?
Do I need a rewrite rule for each of these?
Can you provide me with that rule?
Thanks!
Comment
-
Re: Redirect an old search link to a page
Yep, redirects don't look at query strings so rewrites will be needed:Originally posted by achievingexcellence View PostHi David,
Thanks the link does contain a query string. See example.
Redirect 301 /Merchant2/merchant.mvc?Screen=SRCH&Store_Code=AE&searchcatco unt=1&srch_author=1&Search=Alan%20Questel /Author-Alan-Questel.html?
Do I need a rewrite rule for each of these?
Can you provide me with that rule?
Thanks!
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/Merchant2/merchant.mvc
RewriteCond %{QUERY_STRING} Screen=SRCH&Store_Code=AE&searchcatcount=1&srch_au thor=1&Search=Alan%20Questel
RewriteRule ^.*$ http://www.domain.com/Author-Alan-Questel.html? [R=301,L]
Just change the domain to your own. On the query string, if that doesn't work, try quoting it and leaving the space as a space:
RewriteCond %{QUERY_STRING} "Screen=SRCH&Store_Code=AE&searchcatcount=1&srch_a uthor=1&Search=Alan Questel"
Comment
-
Comment