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

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8942
    seohelper
    Keymaster

    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?

    #8943
    dwchico

    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: /

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Scroll to Top