Redirect an old search link to a page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • achievingexcellence
    Mini Mivite

    • Sep 2010
    • 30

    #1

    Redirect an old search link to a page

    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?
  • ILoveHostasaurus
    Mega Mivite










    • Mar 2006
    • 4998

    #2
    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?
    David Hubbard
    CIO
    Miva
    [email protected]
    http://www.miva.com

    Comment

    • achievingexcellence
      Mini Mivite

      • Sep 2010
      • 30

      #3
      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

      • ILoveHostasaurus
        Mega Mivite










        • Mar 2006
        • 4998

        #4
        Re: Redirect an old search link to a page

        Originally posted by achievingexcellence View Post
        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!
        Yep, redirects don't look at query strings so rewrites will be needed:

        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"
        David Hubbard
        CIO
        Miva
        [email protected]
        http://www.miva.com

        Comment

        • achievingexcellence
          Mini Mivite

          • Sep 2010
          • 30

          #5
          Re: Redirect an old search link to a page

          Thanks! That works!

          Comment

          Working...
          X