GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.rfc-editor.org — RFC 9309: Robots Exclusion Protocol | RFC Editor View as: RFC 9309: Robots Exclusion Protocol
Proposed Standard
AbstractThis document specifies and extends the "Robots Exclusion Protocol" method originally defined by Martijn Koster in 1994 for service owners to control how content served by their services may be accessed, if at all, by automatic clients known as crawlers. Specifically, it adds definition language for the protocol, instructions for handling errors, and instructions for caching.¶ Status of This MemoThis is an Internet Standards Track document.¶ This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.¶
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
https:// Copyright NoticeCopyright (c) 2022 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(https:// 1. Introduction Skip to TOCThis document applies to services that provide resources that clients can access through URIs as defined in [RFC3986]. For example, in the context of HTTP, a browser is a client that displays the content of a web page.¶ Crawlers are automated clients. Search engines, for instance, have crawlers to recursively traverse links for indexing as defined in [RFC8288].¶ It may be inconvenient for service owners if crawlers visit the entirety of their URI space. This document specifies the rules originally defined by the "Robots Exclusion Protocol" [ROBOTSTXT] that crawlers are requested to honor when accessing URIs.¶ These rules are not a form of access authorization.¶ 1.1. Requirements Language Skip to TOCThe key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶ 2. Specification Skip to TOC2.1. Protocol Definition Skip to TOC The protocol language consists of rule(s) and group(s) that the service
makes available in a file named "robots
2.2. Formal Syntax Skip to TOCBelow is an Augmented Backus-Naur Form (ABNF) description, as described in [RFC5234].¶ robotstxt = *(group / emptyline)
group = startgroupline ; We start with a user-agent
; line
*(startgroupline / emptyline) ; ... and possibly more
; user-agent lines
*(rule / emptyline) ; followed by rules relevant
; for the preceding
; user-agent lines
startgroupline = *WS "user-agent" *WS ":" *WS product-token EOL
rule = *WS ("allow" / "disallow") *WS ":"
*WS (path-pattern / empty-pattern) EOL
; parser implementors: define additional lines you need (for
; example, Sitemaps).
product-token = identifier / "*"
path-pattern = "/" *UTF8-char-noctl ; valid URI path pattern
empty-pattern = *WS
identifier = 1*(%x2D / %x41-5A / %x5F / %x61-7A)
comment = "#" *(UTF8-char-noctl / WS / "#")
emptyline = EOL
EOL = *WS [comment] NL ; end-of-line may have
; optional trailing comment
NL = %x0D / %x0A / %x0D.0A
WS = %x20 / %x09
; UTF8 derived from RFC 3629, but excluding control characters
UTF8-char-noctl = UTF8-1-noctl / UTF8-2 / UTF8-3 / UTF8-4
UTF8-1-noctl = %x21 / %x22 / %x24-7F ; excluding control, space, "#"
UTF8-2 = %xC2-DF UTF8-tail
UTF8-3 = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2UTF8-tail /
%xED %x80-9F UTF8-tail / %xEE-EF 2UTF8-tail
UTF8-4 = %xF0 %x90-BF 2UTF8-tail / %xF1-F3 3UTF8-tail /
%xF4 %x80-8F 2UTF8-tail
UTF8-tail = %x80-BF
2.2.1. The User-Agent Line Skip to TOC Crawlers set their own name, which is called a product token, to find
relevant groups. The product token MUST contain only
uppercase and lowercase letters ("a-z" and "A-Z"),
underscores ("_"), and hyphens ("-").
The product token SHOULD
be a substring of the identification string that the crawler sends to
the service. For example, in the case of HTTP
[RFC9110], the product token
SHOULD be a substring in the User-Agent header.
The identification string SHOULD describe the purpose of
the crawler. Here's an example of a User-Agent HTTP request header
with a link pointing to a page describing the purpose of the
ExampleBot crawler, which appears as a substring in the User-Agent HTTP
header and as a product token in the robots +==========================================+========================+ | User-Agent HTTP header | robots.txt user-agent | | | line | +==========================================+========================+ | User-Agent: Mozilla/5.0 (compatible; | user-agent: ExampleBot | | ExampleBot/0.1; | | | https://www.example.com/bot.html) | | +------------------------------------------+------------------------+ Note that the product token (ExampleBot) is a substring of the User-Agent HTTP header.¶ Crawlers MUST use case- +========================================+========================+ | Two groups that match the same product | Merged group | | token exactly | | +========================================+========================+ | user-agent: ExampleBot | user-agent: ExampleBot | | disallow: /foo | disallow: /foo | | disallow: /bar | disallow: /bar | | | disallow: /baz | | user-agent: ExampleBot | | | disallow: /baz | | +----------------------------------------+------------------------+ If no matching group exists, crawlers MUST obey the group with a user-agent line with the "*" value, if present.¶ +==================================+======================+ | Two groups that don't explicitly | Applicable group for | | match ExampleBot | ExampleBot | +==================================+======================+ | user-agent: * | user-agent: * | | disallow: /foo | disallow: /foo | | disallow: /bar | disallow: /bar | | | | | user-agent: BazBot | | | disallow: /baz | | +----------------------------------+----------------------+ If no group matches the product token and there is no group with a user-agent line with the "*" value, or no groups are present at all, no rules apply.¶ 2.2.2. The "Allow" and "Disallow" Lines Skip to TOCThese lines indicate whether accessing a URI that matches the corresponding path is allowed or disallowed.¶ To evaluate if access to a URI is allowed, a crawler MUST
match the paths in "allow" and "disallow" rules against the URI.
The matching SHOULD be case sensitive. The matching
MUST start with the first octet of the path. The most
specific match found MUST be used. The most specific
match is the match that has the most octets. Duplicate rules in a
group MAY be deduplicated. If an "allow" rule and a "disallow"
rule are equivalent, then the "allow" rule SHOULD be used. If no
match is found amongst the rules in a group for a matching user-agent
or there are no rules in the group, the URI is allowed. The
/robots Octets in the URI and robots If a percent- For example:¶ +==================+=======================+=======================+ | Path | Encoded Path | Path to Match | +==================+=======================+=======================+ | /foo/bar?baz=quz | /foo/bar?baz=quz | /foo/bar?baz=quz | +------------------+-----------------------+-----------------------+ | /foo/bar?baz= | /foo/bar?baz= | /foo/bar?baz= | | https://foo.bar | https%3A%2F%2Ffoo.bar | https%3A%2F%2Ffoo.bar | +------------------+-----------------------+-----------------------+ | /foo/bar/ | /foo/bar/%E3%83%84 | /foo/bar/%E3%83%84 | | U+E38384 | | | +------------------+-----------------------+-----------------------+ | /foo/ | /foo/bar/%E3%83%84 | /foo/bar/%E3%83%84 | | bar/%E3%83%84 | | | +------------------+-----------------------+-----------------------+ | /foo/ | /foo/bar/%62%61%7A | /foo/bar/baz | | bar/%62%61%7A | | | +------------------+-----------------------+-----------------------+ The crawler SHOULD ignore "disallow" and "allow" rules that are not in any group (for example, any rule that precedes the first user-agent line).¶ Implementors MAY bridge encoding mismatches if they
detect that the robots 2.2.3. Special Characters Skip to TOCCrawlers MUST support the following special characters:¶ +===========+===================+==============================+ | Character | Description | Example | +===========+===================+==============================+ | # | Designates a line | allow: / # comment in line | | | comment. | | | | | # comment on its own line | +-----------+-------------------+------------------------------+ | $ | Designates the | allow: /this/path/exactly$ | | | end of the match | | | | pattern. | | +-----------+-------------------+------------------------------+ | * | Designates 0 or | allow: /this/*/exactly | | | more instances of | | | | any character. | | +-----------+-------------------+------------------------------+ If crawlers match special characters verbatim in the URI, crawlers SHOULD use "%" encoding. For example:¶ +============================+====================================+ | Percent-encoded Pattern | URI | +============================+====================================+ | /path/file-with-a-%2A.html | https://www.example.com/path/ | | | file-with-a-*.html | +----------------------------+------------------------------------+ | /path/foo-%24 | https://www.example.com/path/foo-$ | +----------------------------+------------------------------------+ 2.2.4. Other Records Skip to TOC Crawlers MAY interpret other records that are not
part of the robots Parsing of other records MUST NOT interfere with the parsing of explicitly defined records in Section 2. For example, a "Sitemaps" record MUST NOT terminate a group.¶ 2.3. Access Method Skip to TOC The rules MUST be accessible in a file named
"/robots As per [RFC3986], the URI of the robots "scheme:[ For example, in the context of HTTP or FTP, the URI is:¶ https://www.example.com/robots.txt
ftp://ftp.example.com/robots.txt
2.3.1. Access Results Skip to TOC2.3.1.1. Successful Access Skip to TOC If the crawler successfully downloads the robots 2.3.1.2. Redirects Skip to TOC It's possible that a server responds to a robots If a robots If there are more than five consecutive redirects, crawlers
MAY assume that the robots 2.3.1.3. "Unavailable" Status Skip to TOC "Unavailable" means the crawler tries to fetch the robots If a server status code indicates that the robots 2.3.1.4. "Unreachable" Status Skip to TOC If the robots If the robots 2.3.1.5. Parsing Errors Skip to TOC Crawlers MUST try to parse each line of the
robots 2.4. Caching Skip to TOC Crawlers MAY cache the fetched robots 3. Security Considerations Skip to TOC The Robots Exclusion Protocol is not a substitute for valid
content security measures. Listing paths in the robots To protect against attacks against their system, implementors
of robots
4. IANA Considerations Skip to TOCThis document has no IANA actions.¶ 5. Examples Skip to TOC5.1. Simple Example Skip to TOCThe following example shows:¶
User-Agent: *
Disallow: *.gif$
Disallow: /example/
Allow: /publications/
User-Agent: foobot
Disallow:/
Allow:/example/page.html
Allow:/example/allowed.gif
User-Agent: barbot
User-Agent: bazbot
Disallow: /example/page.html
User-Agent: quxbot
EOF
5.2. Longest Match Skip to TOC The following example shows that in the case of two rules, the
longest one is used for matching. In the following case,
/example User-Agent: foobot
Allow: /example/page/
Disallow: /example/page/disallowed.gif
6. References Skip to TOC6.1. Normative References Skip to TOC
6.2. Informative References Skip to TOC
Authors' Addresses Skip to TOCMartijn Koster
Stalworthy Manor Farm
Suton Lane
Wymondham, Norfolk
NR18 9JG
United Kingdom
Email:
m.koster
Gary Illyes
Google LLC
Brandschenkestrasse 110
CH-8002 Zürich
Switzerland
Email:
garyillyes
Henner Zeller
Google LLC
1600 Amphitheatre Pkwy
Mountain View, CA 94043
United States of America
Email:
henner
Lizzi Sassman
Google LLC
Brandschenkestrasse 110
CH-8002 Zürich
Switzerland
Email:
lizzi
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |