Announcement

Collapse
No announcement yet.

Miva overwriting 301 redirects

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

    Miva overwriting 301 redirects

    Is anyone else having an issue with Miva overwriting the 301 re-directs on your .htaccess page? If so, any solutions?

    On my old setup the link was as follows:

    execshirts.com/custom-dress-shirts.htm

    I had to add a category folder so it is now:

    execshirts.com/shirts/custom-dress-shirts.htm

    On my redirects page I have the correct code:

    Redirect 301 /custom-dress-shirts.htm http://www.execshirts.com/shirts/cus...ess-shirts.htm

    But miva is treating this like my old link (sort of) and trying to redirect the customer to:

    http://www.execshirts.com/shirts/cus...m-dress-shirts

    and when the customer gets to this bogus link they get the following message from Miva:

    We're sorry but it appears that the "CTGY,CUSTOM-DRESS-SHIRTS" page is not available at this time

    I thought the 301 overrode everything else? Any thoughts? I am losing business with this.

    #2
    Re: Miva overwriting 301 redirects

    I'm seeing a similar problem. I have a module that generates 301's for selected products. It works fine on MM5, but not on MM9. This just came to my attention a few days ago. I've exchanged a few messages with Support about it already. The module's log file verifies that it is issuing the 301's, but users keep ending up at the NTFD page, so apparently the 301's aren't getting through.
    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


      #3
      Re: Miva overwriting 301 redirects

      Originally posted by execshirts View Post
      Is anyone else having an issue with Miva overwriting the 301 re-directs on your .htaccess page? If so, any solutions?

      On my old setup the link was as follows:

      execshirts.com/custom-dress-shirts.htm

      I had to add a category folder so it is now:

      execshirts.com/shirts/custom-dress-shirts.htm

      On my redirects page I have the correct code:

      Redirect 301 /custom-dress-shirts.htm http://www.execshirts.com/shirts/cus...ess-shirts.htm

      But miva is treating this like my old link (sort of) and trying to redirect the customer to:

      http://www.execshirts.com/shirts/cus...m-dress-shirts

      and when the customer gets to this bogus link they get the following message from Miva:

      We're sorry but it appears that the "CTGY,CUSTOM-DRESS-SHIRTS" page is not available at this time

      I thought the 301 overrode everything else? Any thoughts? I am losing business with this.

      The order in which these things appear in the .htaccess file can be critical. It is possible that the segment of directives that Merchant places in the file got moved and an adjustment is needed. For example, redirects should always come before any rewrites that play a role in the destination page working. If http://www.execshirts.com/shirts/cus...ess-shirts.htm is not a real page, i.e. a static page in a directory called shirts, then that redirect must come before:

      Code:
      RewriteCond %{REQUEST_FILENAME} !-s
      RewriteRule ^shirts/([^/.]+).htm$ /mm5/merchant.mvc?Screen=CTGY&Category_code=$1 [QSA,L]
      in your .htaccess file.
      David Hubbard
      CIO
      Miva
      [email protected]
      http://www.miva.com

      Comment


        #4
        Re: Miva overwriting 301 redirects

        Originally posted by Kent Multer View Post
        I'm seeing a similar problem. I have a module that generates 301's for selected products. It works fine on MM5, but not on MM9. This just came to my attention a few days ago. I've exchanged a few messages with Support about it already. The module's log file verifies that it is issuing the 301's, but users keep ending up at the NTFD page, so apparently the 301's aren't getting through.
        This doesn't sound like a similar issue. Neil's problem is redirects being generated via directives in the .htaccess file, it sounds like you're encountering an issue where a module you've written is trying to issue 301's on the fly in response to incoming requests, without input from the .htaccess. Things in the .htaccess may potentially cause a problem with that, if apache sees and acts on the request in a manner that intercepts the request before it gets to the module, but this would probably need to be investigated with our developers to see the code you're using and what's in the .htaccess on the site in question, along with the request that's coming in.
        David Hubbard
        CIO
        Miva
        [email protected]
        http://www.miva.com

        Comment


          #5
          Re: Miva overwriting 301 redirects

          I am hoping to piggyback off of this post with some redirect help as well.

          We are using the Ultimate Short Links module, with links as follows:

          http://www.americastoolwarehouse.com...s/CATCODE.html

          and

          http://www.americastoolwarehouse.com.../PRODCODE.html

          We need to add and redirect these to include there own sub-folder, so we can switch to Merchant Optimizer (which requires the sub-folder)

          e.g.

          http://www.americastoolwarehouse.com...y/CATCODE.html

          and

          http://www.americastoolwarehouse.com.../PRODCODE.html


          Thank you for any assistance you can provide.

          Regards,

          Eldon

          Comment


            #6
            Re: Miva overwriting 301 redirects

            Originally posted by eldon99 View Post
            I am hoping to piggyback off of this post with some redirect help as well.

            We are using the Ultimate Short Links module, with links as follows:

            http://www.americastoolwarehouse.com...s/CATCODE.html

            and

            http://www.americastoolwarehouse.com.../PRODCODE.html

            We need to add and redirect these to include there own sub-folder, so we can switch to Merchant Optimizer (which requires the sub-folder)

            e.g.

            http://www.americastoolwarehouse.com...y/CATCODE.html

            and

            http://www.americastoolwarehouse.com.../PRODCODE.html


            Thank you for any assistance you can provide.

            Regards,

            Eldon
            There are only two options for you:

            1) If your codes differ in some way that can be used as a key in a pattern, it would be very easy to automate the redirects with just a few lines. For example, if your product codes always start with P and your category codes NEVER start with P, some very simple rewrites would:

            If request is /automotive-tools/P* then redirect to /automotive-tools/product/P*.html
            If request is /automotive-tools/<anything else> then redirect to /automotive-tools/category/<anything else> .html

            2) If your codes are all random with no unique pattern that differentiates them, then your only real option would be to have one redirect statement for every single product and category code so the correct destination URL could be put in. Creating such a list would be fairly easy; if you could send us an export of product codes and an export of category codes, we could generate the relevant redirects for you and load them into the server config instead of the .htaccess file, for performance reasons.
            David Hubbard
            CIO
            Miva
            [email protected]
            http://www.miva.com

            Comment


              #7
              Re: Miva overwriting 301 redirects

              David,

              Thank you for the speedy reply.

              The product code has a 3 character vendor code, followed by a dash. The category code does not contain any dashes. Hopefully that is enough to work your magic?

              e.g.

              Category page:
              http://www.americastoolwarehouse.com...oduct/ROB.html

              Product page:
              http://www.americastoolwarehouse.com...ROB-15800.html

              Just to clarify, the product link does NOT include the category code, but the product code includes the vendor- as part of the code.

              I hope that makes sense.

              Regards,

              Eldon

              PS - There are some product codes that contain more than one dash, so I don't think we can check for only the one dash. Examples below:

              http://www.americastoolwarehouse.com.../ASM-3462.html
              http://www.americastoolwarehouse.com...F1004-5MB.html
              Last edited by eldon99; 06-22-15, 11:04 AM.

              Comment


                #8
                Re: Miva overwriting 301 redirects

                Originally posted by eldon99 View Post
                David,

                Thank you for the speedy reply.

                The product code has a 3 character vendor code, followed by a dash. The category code does not contain any dashes. Hopefully that is enough to work your magic?

                e.g.

                Category page:
                http://www.americastoolwarehouse.com...oduct/ROB.html

                Product page:
                http://www.americastoolwarehouse.com...ROB-15800.html

                Just to clarify, the product link does NOT include the category code, but the product code includes the vendor- as part of the code.

                I hope that makes sense.

                Regards,

                Eldon

                PS - There are some product codes that contain more than one dash, so I don't think we can check for only the one dash. Examples below:

                http://www.americastoolwarehouse.com.../ASM-3462.html
                http://www.americastoolwarehouse.com...F1004-5MB.html
                We may have one issue. Based on how the store is right now, you'd use these rewrites:

                RewriteCond %{REQUEST_URI} ^/automotive-tools/([^-]+)\.html$ [NC]
                RewriteRule ^(.*)$ http://www.americastoolwarehouse.com...tegory/%1.html [R=301,L]
                RewriteCond %{REQUEST_URI} ^/automotive-tools/(.+)\.html$ [NC]
                RewriteRule ^(.*)$ http://www.americastoolwarehouse.com...roduct/%1.html [R=301,L]

                The code in the first one, [^-]+ means match on a pattern that contains any character other than hyphen, and the + means it must have 1 or more characters. Then the second pattern just picks up everything else and makes the assumption it's a product code.

                The problem you're going to have is if you're using any of Merchant's own short links features. Normally those take the format <SCREEN CODE>.html which is the same URL as your old categories, for example, your search page:

                http://www.americastoolwarehouse.com...ools/SRCH.html

                If we put the above redirects in, your search page is going to get redirected to a category page that doesn't exist. I don't think you've enabled Merchant's SEO URL's so your store screens, checkout, etc. are still using long format URL's. If I'm correct on that, then the above will work. Then, down the road when you're sure no one links to the old categories any longer, you would be safe to turn on the short URL's for store screens.
                David Hubbard
                CIO
                Miva
                [email protected]
                http://www.miva.com

                Comment


                  #9
                  Re: Miva overwriting 301 redirects

                  David,

                  Unfortunately, we are using the built-in short links for info pages, and we are using SearchSpring for our Search Screen=Search. We use the built-in short links to we didn't have to change the URL's in the page templates.

                  Comment


                    #10
                    Re: Miva overwriting 301 redirects

                    If that's the case you'll need to use the rewrite for products, manual redirects for every category code, and the built in rewrites for store screens. The category redirects should come before any rewrites, or ideally moved to the server config if it's a large number.
                    David Hubbard
                    CIO
                    Miva
                    [email protected]
                    http://www.miva.com

                    Comment


                      #11
                      Re: Miva overwriting 301 redirects

                      David,

                      We have over 2,000 category pages, so this should be a lot of fun. How do I redirect the product? With the above example, would I need to reverse the logic? ([-]+) instead of ([^-]+) for the product?

                      Regards,

                      Eldon

                      Comment


                        #12
                        Re: Miva overwriting 301 redirects

                        This can be your product redirect assuming codes are made up of ONLY letters, numbers and the dash (even if more than one):

                        RewriteCond %{REQUEST_URI} ^/automotive-tools/([A-Za-z0-9-]+)\.html$ [NC]
                        RewriteRule ^(.*)$ http://www.americastoolwarehouse.com...roduct/%1.html [R=301,L]

                        The hyphen is normally treated as a range indicator but if it occurs at the end it's treated literally.
                        David Hubbard
                        CIO
                        Miva
                        [email protected]
                        http://www.miva.com

                        Comment


                          #13
                          Re: Miva overwriting 301 redirects

                          I guess it's starting to sound like we need to wait for the new redirect manager coming down the pike?

                          Regards,

                          Eldon

                          Comment


                            #14
                            Re: Miva overwriting 301 redirects

                            The new redirect manager is in 9.0004 (due end of next month).
                            Thanks,

                            Rick Wilson
                            CEO
                            Miva, Inc.
                            [email protected]
                            https://www.miva.com

                            Comment


                              #15
                              Re: Miva overwriting 301 redirects

                              David,

                              Thanks but that didn't work. I moved the 301 redirects to the top of the page and confirmed that the code that you mentioned is in the Miva re-write. I found another problem as well. With Chrome or Mozilla as my browser I get the NTFD screen with the extra "?Screen=blue-dress-shirts" added to the URL at the end.

                              If I (or a customer) is using IE they get the same verbage in the browser but the screen is blank except for some parts of html on it. For example:

                              olumn one-fourth align-center toggle-slide-bottom">LINKS LINKS×

                              With nothing else showing!

                              I am not sure what happened but I just had to go back to the SEO settings and remove "enable SEO friendly store front". With that enabled all of the links to my categories where working...but instead of the category contents showing the SMAP page was coming up.
                              Last edited by execshirts; 06-22-15, 08:00 PM.

                              Comment

                              Working...
                              X