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
              • Which to redirect to, www or non-www?
                Perfect007
                Perfect007
                0
                3
                169

              • Www vs no-www duplicate fix?
                Mike_Davis
                Mike_Davis
                0
                8
                147

              • Redirecting non-www to www
                Christy-Correll
                Christy-Correll
                0
                6
                466

              • Www or not www base url
                waqid
                waqid
                0
                6
                565

              • Www to non www
                seoug_2005
                seoug_2005
                0
                9
                543

              • Www vs non-www
                kylesuss
                kylesuss
                0
                6
                808

              • Www vs non www
                Marcus_Miller
                Marcus_Miller
                0
                5
                1.2k

              • .htaccess and www - non www
                mikeusry
                mikeusry
                0
                7
                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