When a search engine spider (crawler) comes to your site, it will look for a special file on your site. That file is called robots.txt and it tells the search engine spider, which Web pages of your site should be indexed and which Web pages should be ignored.
The robots.txt file is a simple text file (no HTML), that must be placed in your root directory, for example:
http://www.yourwebsite.com/robots . txt
The user-agent area contains the name of the robot, robots or all robots.
User-agent: * In this example, the wildcard * means all robots.
User-agent: googlebot In this example, only Google’s robot is excluded.
The next area of the robots.txt file is the Disallow area. In this
area you can exclude a robot or robots from indexing your folders,
images, html pages, scripts or other files.
Disallow: /cgi-bin In this example, only the cgi-bin folder is excluded.
Disallow: /query.html In this example, only the query.html file is excluded.
Exclude all bots in Robots.txt file
If you would like your entire site not to be indexed by any of the search engines you would put this in your robots text file:
If you want to exclude all of the robots from a certain directory on your website, your robots text file would look like this:
If you want to exclude the robot from indexing a certain file in a certain directory, the robots.txt file would look like this:
If you would like to keep a specific search engine robot from
indexing a specific file, the robots.txt file would look like this:
If you want to see more complex examples, of robots.txt files, view the robots.txt files of big Web sites: