Announcement

Collapse
No announcement yet.

301 Redirect to a Renamed Category

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

    301 Redirect to a Renamed Category

    In MM9, I had a category called CA-ADA-Restrooms. I just renamed that category to CA-ADA because we added more California ADA signs that were not for restrooms to it.

    What is the best way to create a 301 redirect from the old name of the category to the new name of the category to catch any of the stray links that may be floating around the interwebs?

    Thx...
    Allen Freeman
    http://ClevelandCreative.com
    http://www.StandardLegal.com

    #2
    Update the .htaccess file with the 301.
    Best,
    Pamela

    Consultant / Developer / Trainer
    Contributing Editor to Practical Ecommerce
    Author of the Official Guides for Miva Merchant
    pamelahazelton.com

    Comment


      #3
      I tried that with with a standard redirect call in htaccess, but I think Miva's URI 'auto-code' within appends the link and breaks it. I placed:

      Code:
      redirect 301 /category/CA-ADA-Restroom.html http://adasignfactory.com/category/CA-ADA.html
      before the Miva auto-code in htaccess, but it 404s the redirect because the auto-code changes the link to:

      Code:
      http://adasignfactory.com/category/CA-ADA.html?Screen=CTGY&Category_code=CA-ADA-Restroom
      which doesn't exist.


      I also tried to create a URI redirect in the Miva admin, but I couldn't get that to work either...
      Last edited by allenfreeman; 05-12-16, 07:32 AM.
      Allen Freeman
      http://ClevelandCreative.com
      http://www.StandardLegal.com

      Comment


        #4
        Do you have [L] after the first redirect? That tells the server that if it finds a match, stop further processing of the htaccess file.
        Bruce Golub
        Phosphor Media - "Your Success is our Business"

        Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
        phosphormedia.com

        Comment


          #5
          Thx Bruce I did not have the [L] after the redirect, but the result was the same when I added it: a 404 'Page 'CTGY,CTGY' no longer exists' generated by a revised URL of
          Code:
          http://adasignfactory.com/category/CA-ADA.html?Screen=CTGY&Category_code=CA-ADA-Restroom
          Last edited by allenfreeman; 05-12-16, 10:34 AM.
          Allen Freeman
          http://ClevelandCreative.com
          http://www.StandardLegal.com

          Comment


            #6
            post the actual lines of the htaccess file. i suspect you've got something wrong.
            Bruce Golub
            Phosphor Media - "Your Success is our Business"

            Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
            phosphormedia.com

            Comment


              #7
              Good idea. Thx. Here is the entire htaccess file:

              Code:
              # -FrontPage-
              
              IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
              
              redirect 301 /Distributors http://adasignfactory.com/DIST.html
              redirect 301 /distributors http://adasignfactory.com/DIST.html
              redirect 301 /DISTRIBUTORS http://adasignfactory.com/DIST.html
              redirect 301 /distributors.html http://adasignfactory.com/DIST.html
              redirect 301 /Distributors.html http://adasignfactory.com/DIST.html
              redirect 301 /category/CA-ADA-Restroom.html http://adasignfactory.com/category/CA-ADA.html[L]
              
              <Limit GET POST>
              order deny,allow
              deny from all
              allow from all
              </Limit>
              <Limit PUT DELETE>
              order deny,allow
              deny from all
              </Limit>
              AuthName adasignfactory.com
              AuthUserFile /home/adasg/public_html/_vti_pvt/service.pwd
              AuthGroupFile /home/adasg/public_html/_vti_pvt/service.grp
              
              
              ### Begin - Inserted by Miva Merchant
              
              DirectoryIndex /mm5/merchant.mvc
              
              RewriteEngine On
              
              RewriteRule ^mm5/admin.mvc? - [QSA,L]
              
              RewriteCond %{REQUEST_FILENAME} !-s
              RewriteRule ^sign/([^/.]+).html$ /mm5/merchant.mvc?Screen=PROD&Product_code=$1 [QSA,L]
              
              RewriteCond %{REQUEST_FILENAME} !-s
              RewriteRule ^category/([^/.]+).html$ /mm5/merchant.mvc?Screen=CTGY&Category_code=$1 [QSA,L]
              
              RewriteCond %{REQUEST_FILENAME} !-s
              RewriteRule ^sign/([^/]+)/([^/.]+).html$ /mm5/merchant.mvc?Screen=PROD&Category_code=$1&Product_code=$2 [QSA,L]
              
              RewriteCond %{REQUEST_FILENAME} !-s
              RewriteRule ^([^/.]+).html$ /mm5/merchant.mvc?Screen=$1 [QSA,L]
              
              ### End - Inserted by Miva Merchant
              
              
              
              
              <ifModule mod_headers.c>
                  Header set Connection keep-alive
              </ifModule>
              
              Header unset Pragma
              FileETag None
              Header unset ETag
              
              <FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|swf|pdf|flv|mp3)$">
              <IfModule mod_expires.c>
               ExpiresActive on
               ExpiresDefault "access plus 14 days"
               Header set Cache-Control "public"
              </IfModule>
              </FilesMatch>
              <FilesMatch "\.(html|htm|xml|txt|xsl)$">
               Header set Cache-Control "max-age=7200, must-revalidate"
              </FilesMatch>
              
              
              <IfModule mod_mime.c>
               AddType application/x-javascript .js
               AddType text/css .css
              </IfModule>
              <IfModule mod_deflate.c>
               AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/javascript
               <IfModule mod_setenvif.c>
                BrowserMatch ^Mozilla/4 gzip-only-text/html
                BrowserMatch ^Mozilla/4\.0[678] no-gzip
                BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
               </IfModule>
               <IfModule mod_headers.c>
                Header append Vary User-Agent env=!dont-vary
               </IfModule>
              </IfModule>
              
              # compress text, HTML, JavaScript, CSS, and XML
              AddOutputFilterByType DEFLATE text/plain
              AddOutputFilterByType DEFLATE text/html
              AddOutputFilterByType DEFLATE text/xml
              AddOutputFilterByType DEFLATE text/css
              AddOutputFilterByType DEFLATE application/xml
              AddOutputFilterByType DEFLATE application/xhtml+xml
              AddOutputFilterByType DEFLATE application/rss+xml
              AddOutputFilterByType DEFLATE application/javascript
              AddOutputFilterByType DEFLATE application/x-javascript
              
              # remove browser bugs
              BrowserMatch ^Mozilla/4 gzip-only-text/html
              BrowserMatch ^Mozilla/4\.0[678] no-gzip
              BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
              Header append Vary User-Agent
              Allen Freeman
              http://ClevelandCreative.com
              http://www.StandardLegal.com

              Comment


                #8
                Add a question mark to the end of that redirect.

                Code:
                 
                 redirect 301 /category/CA-ADA-Restroom.html http://adasignfactory.com/category/CA-ADA.html?

                Comment


                  #9
                  Thanks Dan, that did the trick!

                  What does the ? mean to that line to make it work?
                  Allen Freeman
                  http://ClevelandCreative.com
                  http://www.StandardLegal.com

                  Comment


                    #10
                    the end. yea, you can't use the [L] switch on a Redirect command, that's for rewrite. you can also use:

                    RewriteCond %{REQUEST_FILENAME} !-s
                    RewriteRule ^category/CA-ADA-Restroom.html$ /mm5/merchant.mvc?Screen=CTGY&Category_code=CA-ADA [QSA,L]
                    RewriteRule ^category/([^/.]+).html$ /mm5/merchant.mvc?Screen=CTGY&Category_code=$1 [QSA,L]
                    Bruce Golub
                    Phosphor Media - "Your Success is our Business"

                    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
                    phosphormedia.com

                    Comment


                      #11
                      Thanks Bruce. Anyone else looking to solve this now has the full details. The end! ? lol
                      Allen Freeman
                      http://ClevelandCreative.com
                      http://www.StandardLegal.com

                      Comment

                      Working...
                      X