Redirect all Merchant2 to mm5 Index Page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 2CDev
    Mighty Mivite

    • Mar 2006
    • 504

    #1

    Redirect all Merchant2 to mm5 Index Page

    I have a client that converted from Miva 4 (Merchant2) to Miva 5 (mm5). They put a lot of redirects in their .htaccess file to send old Miva 4 links to the correct new link in Miva five, using this directive:

    RewriteCond %{REQUEST_URI} /Merchant2/merchant.mvc [NC]
    RewriteCond %{QUERY_STRING} ^Screen=PROD&Product_Code=F(.*)&Category_Code=FCS1 &Product_Count=(.*)$ [NC]
    RewriteCond %{QUERY_STRING} .
    RewriteRule ^(.*)$ http://www.mydomain.com/category/OTHER_GAMES.html? [R=301,L]

    But he has found quite a number of Not Founds still coming through in Google WMT. So we put this in there as well:

    ### Redirect Miva 4.XX links ###
    RewriteCond %{REQUEST_FILENAME} /Merchant2/merchant.mvc$
    RewriteRule ^Merchant2/(.*)$ http://www.mydomain.com/mm5/$1 [L,R=301]

    However, this doesn't seem to be doing the trick. Not sure if one directive it out-foxing the other, or what. Help??
    Holly Nelson, CEO of 2C Development Group
    www.2cdevgroup.com
    @2cdevelopment
  • ILoveHostasaurus
    Mega Mivite










    • Mar 2006
    • 4998

    #2
    Re: Redirect all Merchant2 to mm5 Index Page

    Try:

    ### Redirect Miva 4.XX links ###
    RewriteCond %{REQUEST_URI} /Merchant2/merchant.mvc
    RewriteRule ^(.*)$ http://www.mydomain.com/mm5/merchant.mvc [L,R=301]

    The $ on the end of the condition was not necessary because the ?blah stuff is considered part of the query string, not the URI requested. The REQUEST_FILENAME was not working because files ending in .mvc are handed off, typically, to /cgi-bin/mivavm so the real file requested is not actually the merchant.mvc. The lack of question mark on the end of the destination merchant.mvc will allow the browser to keep the query string the same as it was before, so if it was /Merchant2/merchant.mvc?Screen=blah&Product_Code=blah that same thing will be appended to /mm5/merchant.mvc
    David Hubbard
    CIO
    Miva
    [email protected]
    http://www.miva.com

    Comment

    • 2CDev
      Mighty Mivite

      • Mar 2006
      • 504

      #3
      Re: Redirect all Merchant2 to mm5 Index Page

      Excellent, David. Thank you so very much for the quick reply.
      Holly Nelson, CEO of 2C Development Group
      www.2cdevgroup.com
      @2cdevelopment

      Comment

      • 2CDev
        Mighty Mivite

        • Mar 2006
        • 504

        #4
        Re: Redirect all Merchant2 to mm5 Index Page

        David, how do we direct any old Miva 4 links that are not named with the same exact code in Miva 5 to the Miva 5 home page?
        Holly Nelson, CEO of 2C Development Group
        www.2cdevgroup.com
        @2cdevelopment

        Comment

        • ILoveHostasaurus
          Mega Mivite










          • Mar 2006
          • 4998

          #5
          Re: Redirect all Merchant2 to mm5 Index Page

          There's no way for htaccess to know if a code is valid or not, so if you've already accounted for all the valid ones with their own specific redirects, then change the final redirect to:

          ### Redirect Miva 4.XX links ###
          RewriteCond %{REQUEST_URI} /Merchant2/merchant.mvc
          RewriteRule ^(.*)$ http://www.mydomain.com/mm5/merchant.mvc? [L,R=301]
          David Hubbard
          CIO
          Miva
          [email protected]
          http://www.miva.com

          Comment

          • kayakbabe
            Mega Mivite




            • Jun 2008
            • 1520

            #6
            Re: Redirect all Merchant2 to mm5 Index Page

            Miva Merchant doesn't care what the name of the folder it is in.
            Could you have changed the new mm5 folder to be named Merchant2
            so you didn't have to do all those rewrites?

            Comment

            • kayakbabe
              Mega Mivite




              • Jun 2008
              • 1520

              #7
              Re: Redirect all Merchant2 to mm5 Index Page

              also another thought,

              For some of those not so frequent bad urls...
              You could help the search engines clean themselves up faster
              in my NTFD screen I look up the product code that was in the url sent to it.
              also have some old screen codes that I look for and give a new url for.
              if it's not one of these things, they get the ntfd screen.


              besides in the htacess catching the super often requested bad urls...
              i'll catch a few at the NTFD screen too.
              at the top of the NTFD screen page template i do some logic kinda like this (from memory)


              if g.screen cin 'oldjunk1|oldjunk2'
              <mvt:item name="toolkit" param="headeroutput|Status|301 Moved Permanently" />
              <mvt:item name="toolkit" param="vheaderoutput|Location|g.newurl" />
              end if
              if g.screen cin 'otheroldjunk3'
              <mvt:item name="toolkit" param="headeroutput|Status|301 Moved Permanently" />
              <mvt:item name="toolkit" param="vheaderoutput|Location|g.newurl" />
              if g.prod eq "oldpopularproductcode'
              <mvt:item name="toolkit" param="headeroutput|Status|301 Moved Permanently" />
              <mvt:item name="toolkit" param="vheaderoutput|Location|g.newurl" />
              end if

              Comment

              Working...
              X