Using robots.txt, how do you disallow the root of a site (http://www.example.com/) but allow a subdirectory (http://www.example.com/lessons/)?
Tell me more
×
Webmasters Stack Exchange is a question and answer site for
pro webmasters. It's 100% free, no registration required.
This does disallow the entire website, but explicitly allows given directories. |
|||||||||
|
|
You must list the Allow lines first as the file is read on first match basis.
Reference: http://www.robotstxt.org/norobots-rfc.txt Google provides a tool in webmaster tools for testing your file. I always recommend testing your file. See "Test a site's robots.txt file:" near bottom. http://support.google.com/webmasters/bin/answer.py?hl=en&answer=156449 |
|||
|
|