Forums Forums White Hat SEO robots.txt: disallow sub directory which is a sub domain directory

  • robots.txt: disallow sub directory which is a sub domain directory

    Posted by seohelper on August 16, 2020 at 2:10 am

    I have a directory in my web directory (/webdir/suba) points to a sub domain suba.example.com

    If I disallow this directory in robots.txt will bots also ignore the sub domain?

    dwchico replied 5 years, 7 months ago 1 Member · 1 Reply
  • 1 Reply
  • dwchico

    Guest
    August 16, 2020 at 2:53 am

    Robots.txt is meant to be placed in the root folder for domain to control access to folders and sub folders. Additionally, sub domains are treated as separate sites and require their own robots file.

    So if you want to disallow said sub domain, create a robots file in the root directory for that sub domain and disallow the root.

    User-agent: *

    Disallow: /

Log in to reply.