undefined
Skip to content
Moz logo Menu open Menu close
  • Products
    • Moz Pro
    • Moz Pro Home
    • Moz Local
    • Moz Local Home
    • STAT
    • Moz API
    • Moz API Home
    • Compare SEO Products
    • Moz Data
  • Free SEO Tools
    • Domain Analysis
    • Keyword Explorer
    • Link Explorer
    • Competitive Research
    • MozBar
    • More Free SEO Tools
  • Learn SEO
    • Beginner's Guide to SEO
    • SEO Learning Center
    • Moz Academy
    • SEO Q&A
    • Webinars, Whitepapers, & Guides
  • Blog
  • Why Moz
    • Agency Solutions
    • Enterprise Solutions
    • Small Business Solutions
    • Case Studies
    • The Moz Story
    • New Releases
  • Log in
  • Log out
  • Products
    • Moz Pro

      Your all-in-one suite of SEO essentials.

    • Moz Local

      Raise your local SEO visibility with complete local SEO management.

    • STAT

      SERP tracking and analytics for enterprise SEO experts.

    • Moz API

      Power your SEO with our index of over 44 trillion links.

    • Compare SEO Products

      See which Moz SEO solution best meets your business needs.

    • Moz Data

      Power your SEO strategy & AI models with custom data solutions.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Free SEO Tools
    • Domain Analysis

      Get top competitive SEO metrics like DA, top pages and more.

    • Keyword Explorer

      Find traffic-driving keywords with our 1.25 billion+ keyword index.

    • Link Explorer

      Explore over 40 trillion links for powerful backlink data.

    • Competitive Research

      Uncover valuable insights on your organic search competitors.

    • MozBar

      See top SEO metrics for free as you browse the web.

    • More Free SEO Tools

      Explore all the free SEO tools Moz has to offer.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Learn SEO
    • Beginner's Guide to SEO

      The #1 most popular introduction to SEO, trusted by millions.

    • SEO Learning Center

      Broaden your knowledge with SEO resources for all skill levels.

    • On-Demand Webinars

      Learn modern SEO best practices from industry experts.

    • How-To Guides

      Step-by-step guides to search success from the authority on SEO.

    • Moz Academy

      Upskill and get certified with on-demand courses & certifications.

    • MozCon

      Save on Early Bird tickets and join us in London or New York City

    Unlock flexible pricing & new endpoints
    Moz API

    Unlock flexible pricing & new endpoints

    Find your plan
  • Blog
  • Why Moz
    • Small Business Solutions

      Uncover insights to make smarter marketing decisions in less time.

    • Agency Solutions

      Earn & keep valuable clients with unparalleled data & insights.

    • Enterprise Solutions

      Gain a competitive edge in the ever-changing world of search.

    • The Moz Story

      Moz was the first & remains the most trusted SEO company.

    • Case Studies

      Explore how Moz drives ROI with a proven track record of success.

    • New Releases

      Get the scoop on the latest and greatest from Moz.

    Surface actionable competitive intel
    New Feature

    Surface actionable competitive intel

    Learn More
  • Log in
    • Moz Pro
    • Moz Local
    • Moz Local Dashboard
    • Moz API
    • Moz API Dashboard
    • Moz Academy
  • Avatar
    • Moz Home
    • Notifications
    • Account & Billing
    • Manage Users
    • Community Profile
    • My Q&A
    • My Videos
    • Log Out

The Moz Q&A Forum

  • Forum
  • Questions
  • Users
  • Ask the Community

Welcome to the Q&A Forum

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

  1. Home
  2. SEO Tactics
  3. Technical SEO
  4. I have two robots.txt pages for www and non-www version. Will that be a problem?

Moz Q&A is closed.

After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

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

Technical SEO
4
6
1.4k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as question
Log in to reply
This topic has been deleted. Only users with question management privileges can see it.
  • ramb
    ramb last edited by May 18, 2019, 2:37 PM

    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
    • jasongmcmahon
      jasongmcmahon last edited by May 27, 2019, 10:29 PM May 27, 2019, 10:29 PM

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

      1 Reply Last reply Reply Quote 0
      • topic:timeago_earlier,8 days
      • GastonRiera
        Gaston Riera @ramb last edited by May 19, 2019, 11:34 AM May 19, 2019, 11:34 AM

        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
        • Xiano
          Xiano Subscriber last edited by May 19, 2019, 8:24 AM May 19, 2019, 8:24 AM

          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
          • ramb
            ramb last edited by May 19, 2019, 1:46 AM May 19, 2019, 1:46 AM

            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 May 19, 2019, 11:34 AM Reply Quote 1
            • GastonRiera
              Gaston Riera last edited by May 19, 2019, 12:15 AM May 19, 2019, 12:15 AM

              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
              • 1 / 1
              1 out of 6
              • First post
                1/6
                Last post

              Got a burning SEO question?

              Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


              Start my free trial


              Browse Questions

              Explore more categories

              • Moz Tools

                Chat with the community about the Moz tools.

              • SEO Tactics

                Discuss the SEO process with fellow marketers

              • Community

                Discuss industry events, jobs, and news!

              • Digital Marketing

                Chat about tactics outside of SEO

              • Research & Trends

                Dive into research and trends in the search industry.

              • Support

                Connect on product support and feature requests.

              • See all categories

              Related Questions

              • webbeemoz

                I want to move some pages of my website to a folder and nav menu in those pages should only show inner page links, will it hurt SEO?

                seo consulting seo expert seo page treatment

                Hi, My website has a few SaaS products, to make my website simple i want to move my website some pages to its specific folder structure , so eg website.com/product1/features
                website.com/product1/pricing
                website.com/product1/information and same for product2 and so on, the website.com/product1/.. menu will only show the links of product1 and only one link to homepage (possibly in footer). Please share your opinion will it be a good idea, from UI perspective it will be simple , but i am not sure about SEO perspective, please help thanks

                Technical SEO | Oct 13, 2023, 2:10 AM | webbeemoz
                1
              • btreloar

                Robots.txt Syntax for Dynamic URLs

                I want to Disallow certain dynamic pages in robots.txt and am unsure of the proper syntax. The pages I want to disallow all include the string ?Page= Which is the proper syntax?
                Disallow: ?Page=
                Disallow: ?Page=*
                Disallow: ?Page=
                Or something else?

                Technical SEO | Mar 29, 2017, 11:30 AM | btreloar
                0
              • Alder

                Non-Existent Parent Pages SEO Impact

                Hello, I'm working with a client that is creating a new site. They currently are using the following URL structure: http://clientname.com/products/furry-cat-muffins/ But the landing page for the directory /products/ does not actually have any content. They have a similar issue for the /about/ directory where the menu actually sends you to /about/our-story/ instead of /about/. Does it hurt SEO to have the URL structure set up in this way and also does it make sense to create 301 redirects from /about/ to /about/our-story/?

                Technical SEO | Oct 2, 2015, 7:12 PM | Alder
                0
              • Michael4g

                Duplicate Content Issue WWW and Non WWW

                One of my sites got hit with duplicate content a while ago because Google seemed to be considering hhtp, https, www, and non ww versions of the site all different sites. We thought we fixed it, but for some reason https://www and just https:// are giving us duplicate content again. I can't seem to figure out why it keeps doing this. The url is https://bandsonabudget.com if any of you want to see if you can figure out why I am still having this issue.

                Technical SEO | Feb 5, 2015, 7:50 PM | Michael4g
                1
              • zeepartner

                Robots.txt on http vs. https

                We recently changed our domain from http to https. When a user enters any URL on http, there is an global 301 redirect to the same page on https. I cannot find instructions about what to do with robots.txt. Now that https is the canonical version, should I block the http-Version with robots.txt? Strangely, I cannot find a single ressource about this...

                Technical SEO | Feb 5, 2015, 3:18 PM | zeepartner
                0
              • danatanseo

                We have set up 301 redirects for pages from an old domain, but they aren't working and we are having duplicate content problems - Can you help?

                We have several old domains. One is http://www.ccisound.com  - Our "real" site is http://www.ccisolutions.com  The 301 redirect from the old domain to the new domain works. However, the 301-redirects for interior pages, like: http://www.ccisolund.com/StoreFront/category/cd-duplicators  do not work. This URL should redirect to http://www.ccisolutions.com/StoreFront/category/cd-duplicators  but as you can see it does not. Our IT director supplied me with this code from the HT Access file in hopes that someone can help point us in the right direction and suggest how we might fix the problem: RewriteCond%{HTTP_HOST} ccisound.com$ [NC] RewriteRule^(.*)$ http://www.ccisolutions.com/$1 [R=301,L] Any ideas on why the 301 redirect isn't happening? Thanks all!

                Technical SEO | Aug 14, 2012, 8:52 PM | danatanseo
                0
              • irvingw

                Allow or Disallow First in Robots.txt

                If I want to override a Disallow directive in robots.txt with an Allow command, do I have the Allow command before or after the Disallow command? example: Allow: /models/ford///page* Disallow: /models////page

                Technical SEO | Feb 10, 2015, 7:53 AM | irvingw
                0
              • AndreVanKets

                OK to block /js/ folder using robots.txt?

                I know Matt Cutts suggestions we allow bots to crawl css and javascript folders (http://www.youtube.com/watch?v=PNEipHjsEPU) But what if you have lots and lots of JS and you dont want to waste precious crawl resources? Also, as we update and improve the javascript on our site, we iterate the version number ?v=1.1... 1.2... 1.3... etc. And the legacy versions show up in Google Webmaster Tools as 404s. For example: http://www.discoverafrica.com/js/global_functions.js?v=1.1
                http://www.discoverafrica.com/js/jquery.cookie.js?v=1.1
                http://www.discoverafrica.com/js/global.js?v=1.2
                http://www.discoverafrica.com/js/jquery.validate.min.js?v=1.1
                http://www.discoverafrica.com/js/json2.js?v=1.1 Wouldn't it just be easier to prevent Googlebot from crawling the js folder altogether? Isn't that what robots.txt was made for? Just to be clear - we are NOT doing any sneaky redirects or other dodgy javascript hacks. We're just trying to power our content and UX elegantly with javascript. What do you guys say: Obey Matt? Or run the javascript gauntlet?

                Technical SEO | Mar 16, 2012, 12:28 PM | AndreVanKets
                0

              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
              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 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
              • Accessibility
              • Terms of Use
              • Privacy

              Looks like your connection to Moz was lost, please wait while we try to reconnect.