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. Intermediate & Advanced SEO
    4. Robots.txt: Syntax URL to disallow

    Robots.txt: Syntax URL to disallow

    Intermediate & Advanced SEO
    8 4 479
    • 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.
    • Kuantokusta
      Kuantokusta last edited by

      Did someone ever experience some "collateral damages" when it's about "disallowing" some URLs?

      Some old URLs are still present on our website and while we are "cleaning" them off the site (which takes time), I would like to to avoid their indexation through the robots.txt file.

      The old URLs syntax is "/brand//13" while the new ones are "/brand/samsung/13." (note that there is 2 slash on the URL after the word "brand")

      Do I risk to erase from the SERPs the new good URLs if I add to the robots.txt file the line "Disallow: /brand//" ?

      I don't think so, but thank you to everyone who will be able to help me to clear this out 🙂

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

        You really don't need a robots for that. I would either 301 the old URL (preferred) or have the old URL return a 404. Both will cause the old URL to be removed from the index. A robots nofollow simply leaves it up but tells the robots not to crawl it.

        1 Reply Last reply Reply Quote 1
        • Anti-Alex
          Anti-Alex last edited by

          Yup like Highland mentioned, using your robots.txt for this isn't a good idea. The robots.txt file isn't guaranteed to work anyway. The only sure fire way to get it working is to move all the URLs from the old structure to the new one, then 301 all the old URLs into the new URLs. The 301 minimizes loss to your SEO.

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

            I'll further what Highland and Alex Chan are telling you. If you are using Apache (Linux) then you can redirect your old site links using a 301 redirect and .htaccess which is a very powerful tool. Otherwise, if you are using a IIS server, web.config is what you want to use.

            A really good resource for .htassess is CSS-Tricks: http://css-tricks.com/snippets/htaccess/301-redirects/

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

              Hi guys,

              Thank you for your answers 🙂

              I understand (and agree) with your SEO point of view (301 redirection) but I should have mentioned that these old URLs are leading to a 404 error page for a long time now, we are not considering anymore their SEO strength anymore...

              My goal right now is to find a quick and simple way to tell search engines to not consider this type of old URLs (because of the 404 error pages being constantly found in our pages) : doing the 301 redirection to the right page would be a bit more complex at the moment.

              So: do you think there is a risk that the second slash won't be "considered" in the robots.txt about the "disallow" line I want to add ? (= do search engines will stop to crawl URLs like "/brand/samsung/13" if I add the line "Disallow: /brand//" ?)

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

                (because of the 404 error pages being constantly found in our pages)

                Think of it this way:
                Which is better? Re-routing traffic when it's congested or putting up a road block to back up even more traffic?

                Yes, it's more work to do the 301 redirects but if you have "pages being constantly found" you should give instructions to spiders to take the different path.

                Now, if you are talking about an error such as:
                /brand//samsung/13 SHOULD go to
                /brand/samsung/13
                Then you could EASILY solve this with HTACCESS redirects. I wouldn't risk telling a spider to ignore /brand// because it might have adverse results.

                Kuantokusta 1 Reply Last reply Reply Quote 0
                • Kuantokusta
                  Kuantokusta @AdAgency last edited by

                  "I wouldn't risk telling a spider to ignore /brand// because it might have adverse results."

                  Which adverse results could be expected?

                  1 Reply Last reply Reply Quote 0
                  • Anti-Alex
                    Anti-Alex last edited by

                    You could inadvertently block /brand/ altogether. Just because you use a // doesn't mean Google follows the same rules when crawling.

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    • If I block a URL via the robots.txt - how long will it take for Google to stop indexing that URL?
                      GastonRiera
                      GastonRiera
                      0
                      3
                      98

                    • Robots.txt Disallowed Pages and Still Indexed
                      Igor.Go
                      Igor.Go
                      0
                      3
                      2.9k

                    • Best practice for disallowing URLS with Robots.txt
                      TimHolmes
                      TimHolmes
                      0
                      3
                      650

                    • Will disallowing URL's in the robots.txt file stop those URL's being indexed by Google
                      Martijn_Scheijbeler
                      Martijn_Scheijbeler
                      0
                      11
                      1.6k

                    • Should I disallow all URL query strings/parameters in Robots.txt?
                      OlegKorneitchouk
                      OlegKorneitchouk
                      0
                      5
                      11.2k

                    • Do I need to disallow the dynamic pages in robots.txt?
                      esiow2013
                      esiow2013
                      0
                      11
                      1.0k

                    • Robots.txt disallow subdomain
                      oznappies
                      oznappies
                      0
                      7
                      1.9k

                    • Blocking Dynamic URLs with Robots.txt
                      TaitLarson
                      TaitLarson
                      1
                      4
                      5.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