4

Can I place a robots.txt file inside a subdomain and it only affect that subdomain and not the root domain?

For example:

I have example.com and mysubdomain.example.com. mysite.com already has a robots.txt that does it's own directives. Can I disallow all bots to mysubdomain.example.com by placing a robots.txt inside it's own folder and it not affect my main domain example.com?

1 Answer 1

5

Yes. Whatever the web root for the subdomain is where you would put a robots.txt for that subdomain's contents. It will not affect the root domain and the root domain's robots.txt will not affect the subdomain.

3
  • 1
    Damn, beat me too it by 25secs :) Commented Oct 15, 2014 at 15:50
  • 1
    Ok perfect, thank you. So you could also put a robots.txt inside mysite.com/folder and it would only apply to items in that folder correct? Commented Oct 15, 2014 at 15:52
  • 3
    Actually, no. robots.txt can only be placed in the web root.
    – John Conde
    Commented Oct 15, 2014 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.