Move 301 redirects from .htaccess to URI Management?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kent Multer
    Mega Mivite









    • Mar 2006
    • 3253

    #1

    Move 301 redirects from .htaccess to URI Management?

    Hi folks,

    One of my clients has an .htaccess file that contains hundreds of 301 redirects for old categories or products. Now that they are on version 9, would it be better to delete these from .htaccess and handle them with URI Management?

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










    • Mar 2006
    • 4998

    #2
    Yes, better to have them in the store, because in htaccess, the server has to parse that file and analyze each one to see if it's applicable with every single request, even for static content.
    David Hubbard
    CIO
    Miva
    [email protected]
    http://www.miva.com

    Comment

    • lesliekirk
      Super Moderator











      • Aug 2008
      • 9304

      #3
      Question - can the URI Management handle adding the redirect needed for all the old style links out in the wild to come to the new URI Management links? Or is that going to be a snippet of code that needs to be added?
      Leslie Kirk
      Miva Certified Developer
      Miva Merchant Specialist since 1997
      Previously of Webs Your Way
      (aka Leslie Nord leslienord)

      Email me: [email protected]
      www.lesliekirk.com

      Follow me: X | Facebook | Pinterest

      Comment

      • ILoveHostasaurus
        Mega Mivite










        • Mar 2006
        • 4998

        #4
        If you have old "long format" links to a given site and there is still some component of that link that matches the new style, then that should be handled via rewrite in the htaccess.

        So, if the site was /mm5/merchant.mvc?Screen=PROD&Product_Code=blah and now it's /widgets/blah.html you can just rewrite those:

        RewriteCond %{QUERY_STRING} Screen=PROD&Product_Code=(.*)$ [NC]
        RewriteRule ^(.*)$ http://www.domain.com/widgets/%1.html [R=301,L]

        # same thing to catch prod code in middle of query string
        RewriteCond %{QUERY_STRING} Screen=PROD&Product_Code=(.*)& [NC]
        RewriteRule ^(.*)$ http://www.domain.com/widgets/%1.html [R=301,L]

        David Hubbard
        CIO
        Miva
        [email protected]
        http://www.miva.com

        Comment

        • lesliekirk
          Super Moderator











          • Aug 2008
          • 9304

          #5
          Okay good. What if the store is not using a product or category "identifier" as soon in your /widgets/ (I think?)
          Leslie Kirk
          Miva Certified Developer
          Miva Merchant Specialist since 1997
          Previously of Webs Your Way
          (aka Leslie Nord leslienord)

          Email me: [email protected]
          www.lesliekirk.com

          Follow me: X | Facebook | Pinterest

          Comment

          • ILoveHostasaurus
            Mega Mivite










            • Mar 2006
            • 4998

            #6
            Doesn't matter as long as there is something in the old URL that always maps to the new URL, so if all traditional prod and cat codes have been retained in the new structure, you can catch them all with the two rewrites. If product codes also changed, then the only option is uri management or rewrites for every single changed code since there's nothing to tie them together.
            David Hubbard
            CIO
            Miva
            [email protected]
            http://www.miva.com

            Comment

            • Kent Multer
              Mega Mivite









              • Mar 2006
              • 3253

              #7
              Is there an easy way to import a large number of URLs into URI Management settings? Or will we have to manually enter each one?

              Thanks again --
              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

              • PCINET - Andreas
                Developer Partner




                • Mar 2006
                • 2439

                #8
                You can create a CSV file and import it under data management.
                Andreas Toman
                PCINET, LLC

                Miva Merchant Design, Development, Integration & Support
                We built over 200 Miva Merchant stores!
                Miva shopping cart design & integration service and see our Portfolio!


                e-mail: [email protected]
                web: www.pcinet.com
                LinkedIn: Andreas Toman
                phone: (786) 250-2056 (Miami, FL)

                Comment

                • Kent Multer
                  Mega Mivite









                  • Mar 2006
                  • 3253

                  #9
                  Ah, that's a relief :) . Thanks!

                  P.S. Happy Thanksgiving to everybody! I am thankful for this community, and all the help it gives to my clients and me.
                  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

                  • Kent Multer
                    Mega Mivite









                    • Mar 2006
                    • 3253

                    #10
                    Hi David, I'm just revisiting this issue today. I was looking at your post above where you gave two examples of ..htaccess commands. It looks to me like they are both identical, and I don't understand what the difference is supposed to be. Am I missing something, or was there a typo?

                    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

                    • alphabet
                      Mega Mivite





                      • Aug 2006
                      • 1160

                      #11
                      Yea, you're missing something... the $ and ?

                      The first rewrite condition has a $ symbol which means in Pearl string 'ends with' product code.

                      For urls with a product code within the path, the second condition says that it has a wildcard product code followed with an ampersand.


                      http://www.alphabetsigns.com/

                      Comment

                      • Kent Multer
                        Mega Mivite









                        • Mar 2006
                        • 3253

                        #12
                        Sheesh, I must have read those commands three times, and didn't notice the ampersand versus the dollar sign. Thanks for the clarification!
                        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

                        • Kent Multer
                          Mega Mivite









                          • Mar 2006
                          • 3253

                          #13
                          Hi David, I just ran into a possible snag on this project. The client's store has been around for a while, and it's using MMUI. The docs say that you can't use URI Management on an MMUI store ... but is that true in all cases? We only need partial functionality here.

                          The store is currently running Legacy SEO, and we don't want to change the URL format. We just need URI Management for the 301's. It seems like this might work, if we set up URI Mgmt. for the legacy-style URIs, and switch it on, and don't change anything else. The store could then recognize the incoming links, and the page templates will still be rendering links in that format. Will that work, or are there some pieces of the puzzle that would still be missing?

                          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

                          • Kent Multer
                            Mega Mivite









                            • Mar 2006
                            • 3253

                            #14
                            Hi, I hope I can get an answer on that last question. I have a client who has an actual need for that type of setup. Otherwise he's faced with the choice of either converting his whole store to CSSUI, or putting hundreds of 301's into his .htaccess file. Hope we can find a better way? 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

                            • Rick Wilson
                              Uber Mivite











                              • Aug 2007
                              • 10122

                              #15
                              I've confirmed with Dev, there is none of the URI functionality in MMUI.

                              Also for what it's worth you really should get off MMUI sooner rather than later. It's in my perspective the new "Version 4".
                              Thanks,

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

                              Comment

                              Working...
                              X