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. I have two robots.txt pages for www and non-www version. Will that be a problem?

    I have two robots.txt pages for www and non-www version. Will that be a problem?

    Technical SEO Issues
    6 4 206
    • 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.
    • ramb
      ramb last edited by

      There are two robots.txt pages. One for www version and another for non-www version though I have moved to the non-www version.

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

        Hi ramb,

        It's totally fine to have different robots.txt files for different subdomains.
        Thus said, http://domain.com and http://www.domain.com are different subdomains. Consider the one with non-www as the full root domain.

        In case it is needed, here you have Google's official resource about robots.txt: 
        Learn about Robots.txt file - Search Console help

        Hope it helps.
        Best luck.
        Gast

        1 Reply Last reply Reply Quote 2
        • ramb
          ramb last edited by

          Hi Gatson

          Thank you for your response. Currently, www version of the site is redirected to non-www version, which is the primary(or root) domain.

          But the problem is, I have 2 robots.txt files running for the same site. i.e. same robots.txt file loads on both www and non-www version. (Example https://www.abc.com/robots.txt and https://abc.com/robots.txt).

          Does it affect my site's SEO ??
          Should I redirect www-version of the file to non-www version?
          Your feedback will be highly appreciated.

          Thank you,

          R.

          GastonRiera 1 Reply Last reply Reply Quote 1
          • Xiano
            Xiano last edited by

            Are you redirecting everything on www to non-www? If so, you don't really need a robots.txt to be served for the www subdomain. Google will ignore the original robots.txt file if it is given a 301 anyway.

            1 Reply Last reply Reply Quote 1
            • GastonRiera
              GastonRiera @ramb last edited by

              Hi ramb,

              Short answer: No, it won't affect your ability to rank in Google. Unless both sites (non-www and www version) compete for the same search term and one of them isn't blocked in the correspondent robots.txt file.

              If you can, make sure to have a redirection rule so as everything in the non-www goes to the www.
              It bugs me why aren't you redirecting the complete non-www to the www version.
              Two possibilities come to my mind:

              1. You can't redirect the whole non-www due to some app or technical need. 
                In this case, both versions, if accessible to Google, will be treated as different sites. Thus, you must be sure that both robots file are correct for the given subdomain.
              2. You have a separate website, which contains different content from the www version (this usually happens with subdomains with different page types, such as products.abc.com and categories.abc.com)
                In this case, please be sure that you know what you want to be blocked and have each robots.txt file in their subdomain.

              Keep in mind that Robots file only controls where you don't want googlebot to access in the public version of your website. When a certain page or group of pages are blocked in robots.txt, google won't access them anymore thus not knowing if that page has what it needs to rank for any given search term. Google might rank lower and users will see a note in search results, leading to a lower CTR.

              Hope it helps.
              Best Luck.
              Gaston

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

                It wont affect your SEO, you just don;t need the the non-https version

                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

                • Will a Robots.txt 'disallow' of a directory, keep Google from seeing 301 redirects for pages/files within the directory?
                  DmitriiK
                  DmitriiK
                  0
                  4
                  408

                • Do I have a robots.txt problem?
                  EcommerceSite
                  EcommerceSite
                  0
                  6
                  168

                • Has anyone tested or knows whether it makes a difference to upload a disavow file to both www. and non-www. versions of your site in GWMT?
                  Chris661
                  Chris661
                  0
                  3
                  120

                • Non WWW. versus WWW. versions, current best practice ?
                  irvingw
                  irvingw
                  0
                  6
                  758

                • Should search pages be disallowed in robots.txt?
                  MichaelWeisbaum
                  MichaelWeisbaum
                  0
                  3
                  335

                • Www to non www
                  seoug_2005
                  seoug_2005
                  0
                  9
                  543

                • How do I redirect non www pages to www on a windows server?
                  AlanMosley
                  AlanMosley
                  0
                  6
                  4.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