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. How can I make Google Webmaster Tools see the robots.txt file when I am doing a .htacces redirec?

    How can I make Google Webmaster Tools see the robots.txt file when I am doing a .htacces redirec?

    Technical SEO Issues
    4 3 1.6k
    • 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.
    • RalphinAZ
      RalphinAZ last edited by

      We are moving a site to a new domain.  I have setup an .htaccess file and it is working fine.  My problem is that Google Webmaster tools now says it cannot access the robots.txt file on the old site.  How can I make it still see the robots.txt file when the .htaccess is doing a full site redirect?

      .htaccess currently has:

      Options +FollowSymLinks -MultiViews
      RewriteEngine on
      RewriteCond %{HTTP_HOST} ^(www.)?michaelswilderhr.com$ [NC]
      RewriteRule ^ http://www.s2esolutions.com/ [R=301,L]

      Google webmaster tools is reporting:

      Over the last 24 hours, Googlebot encountered 1 errors while attempting to access your robots.txt. To ensure that we didn't crawl any pages listed in that file, we postponed our crawl. Your site's overall robots.txt error rate is 100.0%.

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

        You could add an exception to the htaccess to allow the robots to be loaded.  You would do this with by adding another condition.  I'd use something like:

        <code>Options +FollowSymLinks -MultiViews
        RewriteEngine on
        RewriteCond %{REQUEST_URI} !/robots.txt
        RewriteCond %{HTTP_HOST} ^(www\.)?michaelswilderhr\.com$ [NC]
        RewriteRule ^ [http://www.s2esolutions.com/](http://www.s2esolutions.com/) [R=301,L]</code>
        

        Disclaimer: I am lucky enough to have people at work who check these things. This hasn't been checked! Use at your own discretion

        However I'll admit that I've never used this. I just stick the 301 in and it all seems to work out fine.  Probably done it on hundreds of domains over the years.

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

          Thank you that seems to be working.

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

            Possible Solitions for your problem:

            .htaccess authentication blocking robots.txt

            http://www.irishwebmasterforum.com/server-technical-administration-tips-and-queries/10892-htaccess-authentication-blocking-robots-txt.html

            301 redirect. How to make an exception for the robots.txt

            http://forum.cs-cart.com/topic/23747-301-redirect-how-to-make-an-exception-for-the-robotstxt/

            1. Canonical robots.txt

            http://digwp.com/2011/03/htaccess-wordpress-seo-security/

            General .htaccess tutorials: http://httpd.apache.org/docs/2.0/howto/htaccess.htmlhttp://httpd.apache.org/docs/2.0/misc/rewriteguide.html

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • Google Webmaster Tools is saying "Sitemap contains urls which are blocked by robots.txt" after Https move...
              vetofunk
              vetofunk
              0
              5
              11.2k

            • Is there a limit to how many URLs you can put in a robots.txt file?
              CraigBradford
              CraigBradford
              0
              10
              1.1k

            • 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

            • Meta Robots Noindex and Robots.txt File
              Devanur-Rafi
              Devanur-Rafi
              0
              2
              125

            • How can I find my Webmaster Tools HTML file?
              healthgrades
              healthgrades
              0
              5
              309

            • What can I do if Google Webmaster Tools doesn't recognize the robots.txt file?
              wrttnwrd
              wrttnwrd
              0
              7
              396

            • Google webmaster tools
              Martijn_Scheijbeler
              Martijn_Scheijbeler
              0
              4
              491

            • Webmaster tools - Restricted by robots.txt
              RyanKent
              RyanKent
              0
              5
              3.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