The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Moz Tools
    4. 301 or canonical for multiple homepage versions?

    301 or canonical for multiple homepage versions?

    Moz Tools
    20 5 2.6k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • kimmiedawn
      kimmiedawn last edited by

      Thank you Paul! Knowing the WHY behind something always solidifies my understanding of a concept. It does make me wonder why the cheat sheet linked by Sangeetac and Moz's Beginner's Guide to SEO both use that scenario as an example for a 301 redirect - it certainly adds to the confusion.

      Alan - while we are on the subject...here is the code I used for the 301 redirect, which was my first ever using .htaccess. The problem is it redirects twice from certain starting points: first from site.com/default.asp to www.site.com/default.asp then to www.site.com/.

      RewriteEngine On
      RewriteCond %{THE_REQUEST} /index.html? [NC]
      RewriteRule ^(./)?index.html?$ /$1 [R=301,L]
      RewriteCond %{THE_REQUEST} /default.asp? [NC]
      RewriteRule ^(.
      /)?default.asp?$ /$1 [R=301,L]
      RewriteCond %{HTTP_HOST} !^www..* [NC]
      RewriteRule ^(.*) http://www.%{HTTP_HOST}/$1 [R=301,L]

      Initially I tried this (which I think is what you are suggesting?), but if I remember correctly, it wasn't taking care of default.asp or index.html (don't quote me on that):

      RewriteEngine On

      RewriteCond %{HTTP_HOST} !^www..* [NC]

      RewriteRule ^(.*) http://www.%{HTTP_HOST}/$1 [R=301,L]

      Thanks for helping me do things the right way!

      ThompsonPaul 1 Reply Last reply Reply Quote 0
      • kimmiedawn
        kimmiedawn last edited by

        I would like to politely add (and first say that I do appreciate anyone's attempt at a helpful response) that it's a very delicate matter to be giving answers without 100% certainty or valid first-hand experience. At least we as a community should be careful to include somewhat of a disclaimer should our answers be anything less than certain. I, for one, do not want to steer anyone down a dangerous path. I do understand it's my responsibility to gauge the accuracy of an answer before I implement it. Think of the potential consequences to someone else if they implement bad/incorrect advice on a site - ouch!

        1 Reply Last reply Reply Quote 0
        • AlanMosley
          AlanMosley last edited by

          you are correct, it want do the index.html or default.asp

          but this rule will solve all your domain problems, not the "!" mean not, so if not the desired domain, then redirect to the desired domain not matter what the domain is. this will fix non www, or any other secondary domain you may have such as oldDomain.com or mergedSite.com

          Options +FollowSymLinks RewriteEngine On
          RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
          RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]

          but if you have a page called default.asp. your site is a classic ASP site, ASP is a Microsoft technology and would be on a Microsoft web server IIS. if so 301 redirects are very easy to do.

          Is your site ASP.is it on a Microsoft IIS server?

          1 Reply Last reply Reply Quote 0
          • kimmiedawn
            kimmiedawn last edited by

            I didn't build the site, nor do I have anything to do with the hosting, but I do have FTP access. I can't remember how or why but I came to the conclusion that it's ASP Classic. Is there a quick way for me to double check? All the files end in .asp if that helps.

            AlanMosley 1 Reply Last reply Reply Quote 0
            • AlanMosley
              AlanMosley @kimmiedawn last edited by

              Yes that's classic asp

              what sort of server is it on windows?

              What sort of webserver IIS? if so what version, if it is 7 or greater it is very easy to do your redirects if you have access to the controlpanel

              1 Reply Last reply Reply Quote 0
              • kimmiedawn
                kimmiedawn last edited by

                So you are saying I should use the following exact code instead of the code I have:

                RewriteEngine On
                RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
                RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]

                And that will take care of the default.asp and index.html as well? And it won't redirect to the www in between, thus creating 2 redirects, correct?

                If you don't mind explaining, what's the working difference between the first code I tried (below) and the above code that makes the above code work?

                RewriteEngine On
                RewriteCond %{HTTP_HOST} !^www..* [NC]
                RewriteRule ^(.*) http://www.%{HTTP_HOST}/$1 [R=301,L]

                1 Reply Last reply Reply Quote 0
                • kimmiedawn
                  kimmiedawn last edited by

                  I don't have access to the control panel and the person who does never did the redirect when I asked so i just did it myself with .htaccess. So did you say I should change it to your code and that will handle everything, including the double redirect?

                  (Edited out a question that I figured out the answer to.)

                  1 Reply Last reply Reply Quote 0
                  • kimmiedawn
                    kimmiedawn last edited by

                    Could the code I used explain why Open Site Explorer won't let me view link data for www.site.com, but shows me www.site.com/default.asp instead? And within that data it shows an incoming link from www.site.com as a 301 redirect. But when I check it in a browser or redirect checker, it shows www.site.com as the final destination. My head hurts.

                    Edit: (This is what OSE says "The URL you've entered redirects to another URL. We're showing results for www.site.com/default.asp since it is likely to have more accurate link metrics. See data for www.site.com instead?")

                    1 Reply Last reply Reply Quote 0
                    • ThompsonPaul
                      ThompsonPaul @kimmiedawn last edited by

                      Glad that was useful, Kimberly. Many times, folks just want a "when this happens, do that" kind of response, but usually in SEO there so many "it depends" aspects to an issue that it's vastly more useful to understand the Why, so you can work out the solution to the specific issue yourself. Sounds like you're that kind of person too.

                      That said - this discussion seems to be going round and round on you. If you want to PM me your site address, I can get a handle on your exact situation and try to explain exactly what's happening. I have my suspicions, but don't want to confuse the issue further with speculation.

                      Paul

                      1 Reply Last reply Reply Quote 0
                      • Cyrus-Shepard
                        Cyrus-Shepard last edited by

                        Hi Kimberly,

                        The rel="canonical" is a good option when you can't 301 a page. If you can 301 a page, such as /index.html or some other duplicate version, it's usually a better way to go. As you said, it removes all doubt about where to send visitors and link equity.

                        Both rel canonicals and 301s pass about the same amount of link equity (thought to be around 85%) so it's safe to use either.

                        Canonical tags are usually best when you have lots of parameters needed to render the page, like homepage?color=red&length=long&manu=apple. In this case it wouldn't make much sense to 301, and the rel canonical is easier to implement.

                        Hope this helps. Best of luck with your SEO.

                        kimmiedawn 1 Reply Last reply Reply Quote 0
                        • kimmiedawn
                          kimmiedawn @Cyrus-Shepard last edited by

                          Cyrus - Thanks. A familiar face - I've seen it attached to many an article that I've read;)

                          While I have you here, maybe you can answer another question related to the situation that has me slightly nervous:

                          I've read warnings about creating a loop with a 301 redirect - and I keep being pointed to default.asp in Open Site Explorer (with the message that the url I entered - www.site.com- redirects to /default.asp) but any redirect checkers I've used don't show that. Would it be obvious if I didn't implement it correctly? It looks fine in the browser.

                          Would a rel canonical tag in addition to a 301 redirect be a good idea?

                          Cyrus-Shepard 1 Reply Last reply Reply Quote 0
                          • kimmiedawn
                            kimmiedawn last edited by

                            In case this is helpful to anyone else reading this post, here is the code I am now using in the .htaccess, which seems to have eradicated the double redirect (thanks to help from phranque and lucy24 at webmasterworld):

                            RewriteEngine On

                            RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/.]+/)*(index.html|default.asp)\ HTTP/

                            RewriteRule ^(([^/.]+/)*)(index|default) http://www.site.com/$1 [R=301,L]

                            RewriteCond %{HTTP_HOST} !^(www.site.com)?$ [NC]

                            RewriteRule (.*) http://www.site.com/$1 [R=301,L]

                            1 Reply Last reply Reply Quote 0
                            • Cyrus-Shepard
                              Cyrus-Shepard @kimmiedawn last edited by

                              Looks like you found the solution below. Nice work!

                              1 Reply Last reply Reply Quote 0
                              • 1 / 1
                              • First post
                                Last post
                              • Very different PA for 2 versions of the same domain homepage - how to fix pls?
                                CamperConnect14
                                CamperConnect14
                                0
                                6
                                301

                              • Can relative links PLUS multiple hompage versions spell disaster?
                                JaneCopland
                                JaneCopland
                                0
                                2
                                95

                              • Rel Canonical
                                Dr-Pete
                                Dr-Pete
                                0
                                5
                                169

                              • 301 redirect
                                kellymandingo
                                kellymandingo
                                0
                                3
                                431

                              • Canonical link on canonical url
                                andyjsi
                                andyjsi
                                0
                                4
                                362

                              • Canonical Confusion
                                FDSConsulting
                                FDSConsulting
                                0
                                7
                                545

                              • Some questions on Canonical tag AND 301 redirect
                                HiveDigitalInc
                                HiveDigitalInc
                                0
                                8
                                1.0k

                              • Rel=canonical
                                DanDeceuster
                                DanDeceuster
                                0
                                2
                                1.1k

                              Get started with Moz Pro!

                              Unlock the power of advanced SEO tools and data-driven insights.

                              Start my free trial
                              Products
                              • Moz Pro
                              • Moz Local
                              • Moz API
                              • Moz Data
                              • STAT
                              • Product Updates
                              Moz Solutions
                              • SMB Solutions
                              • Agency Solutions
                              • Enterprise Solutions
                              • Digital Marketers
                              Free SEO Tools
                              • Domain Authority Checker
                              • Link Explorer
                              • Keyword Explorer
                              • Competitive Research
                              • Brand Authority Checker
                              • Local Citation Checker
                              • MozBar Extension
                              • MozCast
                              Resources
                              • Blog
                              • SEO Learning Center
                              • Help Hub
                              • Beginner's Guide to SEO
                              • How-to Guides
                              • Moz Academy
                              • API Docs
                              About Moz
                              • About
                              • Team
                              • Careers
                              • Contact
                              Why Moz
                              • Case Studies
                              • Testimonials
                              Get Involved
                              • Become an Affiliate
                              • MozCon
                              • Webinars
                              • Practical Marketer Series
                              • MozPod
                              Connect with us

                              Contact the Help team

                              Join our newsletter
                              Moz logo
                              © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                              • Accessibility
                              • Terms of Use
                              • Privacy