learn / Term explained
EN

Collection basics · Terminology explanation

Robots.txt protocol

Robots Exclusion Protocol

Common writing methods: robots.txt, REP

What it means

A convention through which a website's robots.txt file tells automated clients which paths may or should not be crawled. The protocol is defined in RFC 9309.

robots.txt groups rules by user agent and expresses crawl preferences through Allow and Disallow. Match paths and handle file-fetch status according to the protocol instead of using a simple substring test for every URL.

The Robots protocol manages automated crawling, not access permissions. It cannot protect sensitive content or replace website authentication, terms of service or specific data-use authorization.

RFC 9309 distinguishes unavailable files from unreachable ones. A 404 fetching robots.txt is an unavailable 4xx: crawlers MAY access resources. A 5xx or network error is unreachable: they MUST initially assume complete disallow. Cached rules and prolonged failures require the protocol’s caching and long-term unreachability provisions.

A cache SHOULD NOT normally be used for more than 24 hours, except when robots.txt is unreachable. Here 404 and 503 refer to the robots file itself, not a target content page. MAY permits access rather than requiring it; SHOULD NOT is not an unconditional hard 24-hour expiry.

In a scraping task

Add rule checking for task scope

After the crawler finds a new link, it first confirms that it belongs to the task scope, and then determines whether to access it according to the applicable robots.txt rules. Banned paths should not be automatically enqueued just because they exist in links within the site.

User-agent: *
Disallow: /private/
Allow: /public/

Common misconceptions

  • Allowing crawling in robots.txt does not mean that the data can be used arbitrarily.
  • Just because there is no sensitive path written to robots.txt does not mean that it is access-protected.

References

Organized by Northleaf Studio. The source link retains the original address to facilitate continued reading.

Back to glossary