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. Will a Robots.txt 'disallow' of a directory, keep Google from seeing 301 redirects for pages/files within the directory?

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

    Technical SEO Issues
    4 2 408
    • 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.
    • Voodak
      Voodak last edited by

      Hi- I have a client that had thousands of dynamic php pages indexed by Google that shouldn't have been.  He has since blocked these php pages via robots.txt disallow.  Unfortunately, many of those php pages were linked to by high quality sites mulitiple times (instead of the static urls) before he put up the php 'disallow'.

      If we create 301 redirects for some of these php URLs that area still showing high value backlinks and send them to the correct static URLs, will Google even see these 301 redirects and pass link value to the proper static URLs?  Or will the robots.txt keep Google away and we lose all these high quality backlinks?   I guess the same question applies if we use the canonical tag instead of the 301.  Will the robots.txt keep Google from seeing the canonical tags on the php pages?

      Thanks very much,

      V

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

        Hello, my friend.

        You should realize how exactly htaccess' 301 redirects work. They are server side commands/operations. So, when bots request a page, they wait until server response. In case of 301s - they get response "Don't go here, go there". Now, they also may get response from robots.txt saying "you're not allowed to look at the contents of this file/directory", however this will not prevent the server response. That's why sometimes you can see indexed pages, which are saying "blocked by robots". They are indexed though.

        Now, in case of canonical links you are correct, since canonical is IN the content of the page, then robots won't be able to read it, therefore won't be able to be told that there is a canonical page.

        There is a recent WBF on this subject - https://moz.com/blog/controlling-search-engine-crawlers-for-better-indexation-and-rankings-whiteboard-friday

        Hope this clarifies some things.

        1 Reply Last reply Reply Quote 3
        • Voodak
          Voodak last edited by

          Hello Dmitrii,

          Yes, that clarifies things perfectly. Thanks very much for your explanation. And I missed this particular WBF, so I will give it a close look as well.

          Thanks again for your quick help.

          DmitriiK 1 Reply Last reply Reply Quote 0
          • DmitriiK
            DmitriiK @Voodak last edited by

            No problem 🙂

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • Crawl solutions for landing pages that don't contain a robots.txt file?
              Nomader
              Nomader
              1
              10
              353

            • Will redirecting a logged in user from a public page to an equivalent private page (not visible to google) impact SEO?
              0
              1
              28

            • Robots txt. in page with 301 redirect
              LauraSultan
              LauraSultan
              0
              6
              3.1k

            • Google showing https:// page in search results but directing to http:// page
              JaneCopland
              JaneCopland
              0
              4
              218

            • Robots.txt to disallow /index.php/ path
              Mikkehl
              Mikkehl
              0
              9
              7.1k

            • To 301 redirect or not to 301 redirect? duplicate content problem www.domain.com and www.domain.com/en/
              Chris-CA
              Chris-CA
              0
              5
              456

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

            • Robots.txt File Redirects to Home Page
              NickPateman81
              NickPateman81
              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