Difference between revisions of "Robots Exclusion Standard"
(→External links) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 57: | Line 57: | ||
Google uses comments for the same purpose: <tt><nowiki><!--googleoff: index--> ... <!--googleon: index--></nowiki></tt> | Google uses comments for the same purpose: <tt><nowiki><!--googleoff: index--> ... <!--googleon: index--></nowiki></tt> | ||
− | ==See also== | + | == See also == |
+ | * [[.htaccess]] | ||
+ | * [[Rewrite engine|mod_rewrite]] | ||
* [[Web crawler]] | * [[Web crawler]] | ||
* [[Spam in blogs#rel=nofollow|The nofollow attribute]] | * [[Spam in blogs#rel=nofollow|The nofollow attribute]] | ||
Line 64: | Line 66: | ||
<references /> | <references /> | ||
==External links== | ==External links== | ||
− | |||
*[http://www.fleiner.com/bots/ How to keep bad robots, spiders and web crawlers away] | *[http://www.fleiner.com/bots/ How to keep bad robots, spiders and web crawlers away] | ||
− | |||
*[http://www.kloth.net/internet/badbots.php List of Bad Bots]: A short list of bad spiders and nasty bots seen on my different web sites | *[http://www.kloth.net/internet/badbots.php List of Bad Bots]: A short list of bad spiders and nasty bots seen on my different web sites | ||
*[http://laffey.tv/favicon_error_logs.html HOWTO: Serving up default favicon.ico and robots.txt files with Apache] | *[http://laffey.tv/favicon_error_logs.html HOWTO: Serving up default favicon.ico and robots.txt files with Apache] | ||
Line 73: | Line 73: | ||
*[http://www.robotstxt.org/wc/exclusion.html Robots Exclusion] | *[http://www.robotstxt.org/wc/exclusion.html Robots Exclusion] | ||
*[http://www.yellowpipe.com/yis/tools/robots.txt/ Robots.txt Online Generator] | *[http://www.yellowpipe.com/yis/tools/robots.txt/ Robots.txt Online Generator] | ||
− | + | *[http://www.theinquirer.net/?article=19357 White House site has oddities, like Bush site], Nick Farrell (29 October 2004) | |
− | *[http://www.theinquirer.net/?article=19357 White House site has oddities, like Bush site], Nick Farrell (October | + | |
*[http://www.cre8asiteforums.com/forums/index.php?showtopic=8412&hl= Comprehensive Robots.txt Tutorial] | *[http://www.cre8asiteforums.com/forums/index.php?showtopic=8412&hl= Comprehensive Robots.txt Tutorial] | ||
*[http://www.servergrade.com.au/faq/answers/robots-text.html Using Robots.txt To Manage Search Engine Spiders] | *[http://www.servergrade.com.au/faq/answers/robots-text.html Using Robots.txt To Manage Search Engine Spiders] | ||
− | [ | + | ===Examples=== |
+ | *[http://www.askapache.com/seo/seo-with-robotstxt.html SEO with Robots.txt] — by AskApache | ||
+ | |||
[[Category:World Wide Web]] | [[Category:World Wide Web]] |
Latest revision as of 23:40, 30 May 2012
The robots exclusion standard or robots.txt protocol is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a website. The information specifying the parts that should not be accessed is specified in a file called robots.txt in the top-level directory of the website.
The robots.txt patterns are matched by simple substring comparisons, so care should be taken to make sure that patterns matching directories have the final '/' character appended: otherwise all files with names starting with that substring will match, rather than just those in the directory intended.
Contents
Examples
This example allows all robots to visit all files because the wildcard "*" specifies all robots.
User-agent: * Disallow:
This example keeps all robots out:
User-agent: * Disallow: /
The next is an example that tells all crawlers not to enter into four directories of a website:
User-agent: * Disallow: /cgi-bin/ Disallow: /images/ Disallow: /tmp/ Disallow: /private/
Example that tells a specific crawler not to enter one specific directory:
User-agent: BadBot Disallow: /private/
Example demonstrating how comments can be used:
# Comments appear after the "#" symbol at the start of a line, or after a directive User-agent: * # match all bots Disallow: / # keep them out
Compatibility
In order to prevent access to all pages by robots,
Disallow: *
is not appropriate as this is not a stable standard extension. For example, despite the fact that Google claims support for this tag[1], it in fact does not[2].
Instead:
Disallow: /
should be used.
Alternatives
robots.txt is older and more widely accepted, but there are other methods (which can be used together with robots.txt) that allow greater control, like disabling indexing of images only or disabling archiving of page contents.
HTML meta tags for robots
HTML meta tags can be used to exclude robots according to the contents of web pages. Again, this is purely advisory, and also relies on the cooperation of the robot programs. For example,
<meta name="robots" content="noindex,nofollow" />
within the HEAD
section of an HTML document tells search engines such as Google, Yahoo!, or MSN to exclude the page from its index and not to follow any links on this page for further possible indexing.
(See HTML Author's Guide to the Robots META tag.)
Directives within a page
The <NOINDEX> tag is a non-standard HTML tag whose intent is to indicate portions of a page that should not be indexed, such as common navigation or footer. Using it without a namespace will make XHTML pages invalid.
Google uses comments for the same purpose: <!--googleoff: index--> ... <!--googleon: index-->
See also
References
External links
- How to keep bad robots, spiders and web crawlers away
- List of Bad Bots: A short list of bad spiders and nasty bots seen on my different web sites
- HOWTO: Serving up default favicon.ico and robots.txt files with Apache
- Robots.txt Checker (validates robots.txt files and gives optimization tips)
- A Standard for Robot Exclusion
- Robots Exclusion
- Robots.txt Online Generator
- White House site has oddities, like Bush site, Nick Farrell (29 October 2004)
- Comprehensive Robots.txt Tutorial
- Using Robots.txt To Manage Search Engine Spiders
Examples
- SEO with Robots.txt — by AskApache