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. Technical SEO Issues
    4. Www vs no-www duplicate fix?

    Www vs no-www duplicate fix?

    Technical SEO Issues
    8 3 147
    • 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.
    • Becky_Converge
      Becky_Converge last edited by

      Hi all, I have more or less published two versions of our site. One on "www" and one without. And of course we uncovered it during our SEO crawl as "duplicate" content/titles. My guess (hope) is this is something that can be easily fixed on the server side, but I don't have a lot of knowledge around it. Does anyone know?

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

        Easy fix:

        in your .htaccess file, use this

        RewriteEngine On
        
        RewriteCond %{HTTP_HOST} !^domain\.com
        
        RewriteRule (.*) http://domain.com/$1 [R=301,L]
        
        Remember to replace domain.com with your domain name.
        Enjoy!
        
        Becky_Converge 1 Reply Last reply Reply Quote 2
        • irvingw
          irvingw last edited by

          also go into Google Webmaster tools and set the www preference under configuration

          1 Reply Last reply Reply Quote 1
          • Becky_Converge
            Becky_Converge last edited by

            Thank you both for your responses! I was hoping it would be something as simple as this.

            Best,

            Becky

            1 Reply Last reply Reply Quote 0
            • Becky_Converge
              Becky_Converge @Mike_Davis last edited by

              Quick question on this - will this code set it sobe setting it so the url will read the "www" or without?

              Mike_Davis 1 Reply Last reply Reply Quote 0
              • Mike_Davis
                Mike_Davis @Becky_Converge last edited by

                This will make it non www.  If you want it to default to www use this:

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

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

                  One more follow up - what about for an IIS server?

                  Mike_Davis 1 Reply Last reply Reply Quote 0
                  • Mike_Davis
                    Mike_Davis @Becky_Converge last edited by

                    Here you go:

                    http://www.mcanerin.com/en/articles/301-redirect-iis.asp

                    Enjoy!

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    • Duplicate Content Showing up on Moz Crawl | www. vs. no-www.
                      MarketingChimp10
                      MarketingChimp10
                      0
                      5
                      299

                    • Duplicate Page Content for www and non-www. Help!
                      Andy.Drinkwater
                      Andy.Drinkwater
                      0
                      7
                      486

                    • Need Help With WWW vs. Non-WWW Duplicate Pages
                      mosquitohawk
                      mosquitohawk
                      0
                      2
                      197

                    • Rel=Canonical, WWW vs non WWW and SEO
                      Saijo.George
                      Saijo.George
                      0
                      3
                      3.3k

                    • How do I stop www.mysite.com/ showing as a duplicate of www.mysite.com
                      Dr-Pete
                      Dr-Pete
                      0
                      5
                      509

                    • Why do I get duplicate pages, website referencing the capital version of the url vs the lowercase www.agi-automation.com/Pneumatic-grippers.htm
                      TimKelsey
                      TimKelsey
                      0
                      7
                      547

                    • Www vs non www and understanding opensite
                      wedmonds
                      wedmonds
                      0
                      7
                      1.1k

                    • Www vs non www
                      Marcus_Miller
                      Marcus_Miller
                      0
                      5
                      1.2k

                    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