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 or no www

    Www or no www

    Technical SEO Issues
    5 3 807
    • 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.
    • dschreib_greenpeace.org
      dschreib_greenpeace.org last edited by

      right now our organization has the a robot text file set to block search engines from indexing the non-www version of our URL - example.com

      looks like this

      #Dynamically generated robots.txt file for example.com
      User-agent: *

      Disallow: /

      Of course, we do allow search engines to crawl the www. version

      Is this the best way to do this?

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

        Hi Kevin

        That is a risk, you could end up blocking search engines from indexing your entire website. Usually, both www and non-www point to the same location, so one robots.txt file can apply to both (unless you've configured your site differently).

        Check out  http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=44231

        I'd suggest removing that Disallow command within your robots.txt file and do the following:

        Within Google Webmaster Tools, go to 'Site configuration' 'Settings' ~ from there you can set how you'd like your pages to be displayed in Google's search results, either with or without the www. (or can leave Google to decide).

        Regards

        Simon

        dschreib_greenpeace.org 1 Reply Last reply Reply Quote 1
        • Webfor
          Webfor last edited by

          I wouldn't recommend setting your robots.txt to disallow indexing of the site without www. The best method is to create a domain wide 301 redirect using .htaccess. You should also set it up in Google Webmaster tools under settings and select with www as your preferred domain. Below is an example of the rewrite in .htaccess.

          RewriteEngine on

          RewriteCond %{HTTP_HOST} ^mysite.com [NC]

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

          Hope that helps!

          Kevin

          dschreib_greenpeace.org 1 Reply Last reply Reply Quote 1
          • dschreib_greenpeace.org
            dschreib_greenpeace.org @Webfor last edited by

            Thanks so much Kevin. Much appreciated!

            1 Reply Last reply Reply Quote 0
            • dschreib_greenpeace.org
              dschreib_greenpeace.org @SimonCullum last edited by

              Likewise to you Simon, thanks a lot for the advice!

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • Worth redirecting non-www to www due to higher page authority with www?
                GastonRiera
                GastonRiera
                0
                4
                276

              • Best Practice for www and non www
                salem4e
                salem4e
                0
                4
                8.4k

              • SSL, www issue. Should we buy WWW license or just add redirect from www to non-www site?
                Ryan_V
                Ryan_V
                0
                8
                141

              • WWW and Without WWW Backlinks
                TakeshiYoung
                TakeshiYoung
                0
                3
                806

              • Having www. and non www. links indexed
                AdamThompson
                AdamThompson
                0
                6
                370

              • Www vs non-www which is better?
                ReviveMedia
                ReviveMedia
                0
                12
                31.7k

              • How do I redirect non-www to www in IIS?
                tylerfraser
                tylerfraser
                0
                2
                986

              • Www or no www in search results??
                Giggy
                Giggy
                0
                4
                1.0k

              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