Announcement

Collapse
No announcement yet.

Need to redirect old miva generated dynamic url's to new static html pages

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Need to redirect old miva generated dynamic url's to new static html pages

    Hi, We need to redirect old miva generated dynamic url's to new static html pages.

    Miva said this code would work, but it doesn't.

    RewriteCond %{QUERY_STRING} ^Screen=CTGY&Category_Code=Spirit-Shop$ [NC]
    RewriteRule ^(.*)$ http://www.spiritaccessories.com/sto...r-apparel.html [R=301,L]

    This is the dynamic url we want to redirect: http://www.spiritaccessories.com/Mer...de=Spirit-Shop

    This is the static html page where we want that redirect to go: http://www.spiritaccessories.com/sto...r-apparel.html

    Please help!! We have several hundred links that need to be redirected in order to help our SEO rankings.

    Thank you,
    Joshua

    #2
    Re: Need to redirect old miva generated dynamic url's to new static html pages

    Do you have "RewriteEngine On" in your htaccess file before any rewrites occur?
    David Hubbard
    CIO
    Miva
    [email protected]
    http://www.miva.com

    Comment


      #3
      Re: Need to redirect old miva generated dynamic url's to new static html pages

      Originally posted by ILoveHostasaurus View Post
      Do you have "RewriteEngine On" in your htaccess file before any rewrites occur?
      Yes, this is the code at the top of the .htaccess file:

      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-s

      Comment


        #4
        Re: Need to redirect old miva generated dynamic url's to new static html pages

        Try moving the new redirection rewrites to the top of the file just under the RewriteEngine On directive; the other rules handling non-existent files may be interfering.
        David Hubbard
        CIO
        Miva
        [email protected]
        http://www.miva.com

        Comment


          #5
          Re: Need to redirect old miva generated dynamic url's to new static html pages

          I tried doing that, and it worked. However, when I started adding more and more redirects they started going to a page that said it was looping. I have attached a text document of what I've got so far, as well as all of the dynamic url's I need to be redirected.
          Can you tell me if there has to be a different redirect formula for every single dynamic link, or what?
          Attached Files

          Comment


            #6
            Re: Need to redirect old miva generated dynamic url's to new static html pages

            Ah, yes, try adding a ? on the end of the destination URL's in your redirects. The issue is that web browsers add the original query string onto the end of the new URL, trying to be helpful, but in this case it causes the redirect to occur repeatedly because after being told to go to http://www.spiritaccessories.com/sto...es-charms.html, the browser turns it into http://www.spiritaccessories.com/sto...roduct_Code=07 which triggers the redirect again. The ? will tell the browser to strip the arguments.
            David Hubbard
            CIO
            Miva
            [email protected]
            http://www.miva.com

            Comment


              #7
              Re: Need to redirect old miva generated dynamic url's to new static html pages

              I have a similar issue I have an old
              /Merchant2/merchant.mvc?Screen=CTGY&Store_Code=HDT&Category_C ode=COWSTOR

              link that i want to link to the new pslt.html code but if I add to the redirect 301 it does not work correctly is there a default rewrite that is conflicting these.
              Marshall
              http://www.hmcdisplay.com
              http://www.churchonwheels.com

              Comment


                #8
                Re: Need to redirect old miva generated dynamic url's to new static html pages

                Originally posted by marshallw View Post
                I have a similar issue I have an old
                /Merchant2/merchant.mvc?Screen=CTGY&Store_Code=HDT&Category_C ode=COWSTOR

                link that i want to link to the new pslt.html code but if I add to the redirect 301 it does not work correctly is there a default rewrite that is conflicting these.
                RewriteCond %{REQUEST_URI} ^/Merchant2/merchant.mvc
                RewriteCond %{QUERY_STRING} Screen=CTGY&Store_Code=HDT&Category_Code=COWSTOR [NC]
                RewriteRule ^(.*)$ http://www.domain.com/pslt.html? [R=301,L]
                David Hubbard
                CIO
                Miva
                [email protected]
                http://www.miva.com

                Comment


                  #9
                  Re: Need to redirect old miva generated dynamic url's to new static html pages

                  FYI, I'm just getting started on a custom-module project to address these issues. The module will have a database table of conversions from old product or category codes to new ones; and it will issue 301 redirects to users who try to get to the old URLs. Anyone else who's interested in this is welcome to drop me a line; maybe the cost can be shared by several users.

                  Thanks --
                  Kent Multer
                  Magic Metal Productions
                  http://TheMagicM.com
                  * Web developer/designer
                  * E-commerce and Miva
                  * Author, The Official Miva Web Scripting Book -- available on-line:
                  http://www.amazon.com/exec/obidos/IS...icmetalproducA

                  Comment

                  Working...
                  X