Where site files live: the root path and /.well-known/
Clients find machine-readable site files at fixed addresses: some at the root of each host, some under the /.well-known/ prefix of RFC 8615, and some inside every page. Where a file sits also decides which URLs it can speak for.
Type: BeginnerOn this page
A crawler does not search a site for its rules. It requests one fixed address and acts on whatever comes back, a 404 included. The location of each file is therefore part of its specification. A robots.txt file uploaded to /docs/robots.txt is, as far as any crawler is concerned, not a robots.txt file at all, and a sitemap stored in a subdirectory can only describe pages beneath that directory.
Three patterns are in use. Formats that predate any registry claim a name at the root of the host, as robots.txt does. Formats designed since RFC 5785 introduced the /.well-known/ prefix in 2010 are expected to register a name under it, as security.txt does. And some metadata has no file of its own because it is carried inside each HTML page or in the HTTP headers of each response.
Paths at a glance
| Format | Address | Defined by | Applies to |
|---|---|---|---|
| robots.txt | /robots.txt, exactly, in lowercase | RFC 9309 | The scheme, host and port it was fetched from |
| XML sitemap | Any path; /sitemap.xml by convention | Sitemaps 0.9 (sitemaps.org) | URLs in its own directory and below, on the same scheme and host, unless robots.txt vouches for it |
| Sitemap index | Any path | Sitemaps 0.9 | Sitemaps on the same site |
| llms.txt | /llms.txt, or a subpath such as /docs/llms.txt | llms.txt proposal (llmstxt.org) | Pages under the path it sits in |
| security.txt | /.well-known/security.txt | RFC 9116 | The domain or IP address it was fetched from, not its subdomains or parent domains |
| JSON-LD structured data | Inside each page, in a script element of type application/ld+json | JSON-LD 1.1 (W3C) with the schema.org vocabulary | The page that contains it |
| Robots meta tag, canonical link | Inside each page's head, or as an HTTP header | Google and Bing documentation; RFC 6596 | The page or file it is attached to |
The /.well-known/ prefix
RFC 8615, published in May 2019, reserves the path prefix /.well-known/ in http, https, ws and wss URIs for what it calls site-wide metadata. It replaced RFC 5785. The aim is to stop each new protocol from claiming a different top-level name and colliding with paths that site owners already use. A specification that needs such a location registers a name with IANA, and the file then lives at /.well-known/ followed by that name.
- A registered name is a single path segment, so it cannot contain a slash. Further path components, if any, are defined by the registering specification.
- The prefix only counts at the top of the path. /.well-known/example is a well-known URI; /blog/.well-known/example is not.
- Nothing is defined at /.well-known/ itself. Clients should not expect a directory listing or any resource there.
- Entries in the registry are either permanent or provisional. Values defined by Standards Track RFCs and other open standards are permanent; others are normally provisional and can be removed if they fall out of use.
The IANA Well-Known URIs registry held 107 entries at its update of 26 October 2026, among them acme-challenge (RFC 8555, used to prove control of a domain when a certificate is issued) and webfinger (RFC 7033). security.txt is registered as permanent, with RFC 9116 as its specification. robots.txt is not in the registry: it is older than the mechanism, and RFC 9309 keeps it at the root. Neither llms.txt nor any sitemap name is registered either.
One robots.txt per host
RFC 9309 section 2.3 requires the rules to be served from a file named /robots.txt in the top-level path of the service, and gives its address as scheme:[//authority]/robots.txt. Because the authority includes the host name and any port, a robots.txt file speaks only for the scheme, host and port it was fetched from. Google's robots.txt documentation draws the practical conclusions: a file on a subdomain is valid only for that subdomain, and a file served on a non-standard port covers only content served on that port.
| URL a crawler wants | robots.txt it reads |
|---|---|
| https://example.com/docs/guide | https://example.com/robots.txt |
| https://www.example.com/docs/guide | https://www.example.com/robots.txt |
| https://docs.example.com/guide | https://docs.example.com/robots.txt |
| http://example.com/docs/guide | http://example.com/robots.txt |
| https://example.com:8443/docs/guide | https://example.com:8443/robots.txt |
A site with a documentation subdomain, a blog subdomain and the main host therefore needs three files, even if they are identical. A redirect is allowed: the RFC says crawlers should follow at least five consecutive redirects, even to another host, and apply the rules they find to the host they started from. Redirecting http://example.com/robots.txt to the https version is the common case. The syntax of the file itself is covered in robots.txt syntax: groups, rules and matching.
A sitemap's location limits what it can list
The Sitemaps protocol ties a sitemap's scope to its address. A file at https://example.com/catalog/sitemap.xml may list any URL that starts with https://example.com/catalog/, but not https://example.com/images/ and not the http version of the same pages. All listed URLs must use the same scheme and host as the sitemap, and the same port if one is given. URLs outside that scope are dropped. For that reason the protocol recommends putting the sitemap, or the sitemap index, at the root of the server.
There is one exception. A host's robots.txt file can point to a sitemap stored on a different host, and doing so counts as proof that whoever controls the first host trusts that sitemap. The protocol calls this cross-submission. The target sitemap should then contain URLs of the host that points to it, and only those.
User-agent: *
Disallow: /search
Sitemap: https://static.example.net/sitemaps/www-example-com.xmlHow crawlers find sitemaps in the first place is covered in how crawlers find a sitemap, and splitting a large set of sitemaps under one index in sitemap index files.
llms.txt at the root or under a path
The llms.txt proposal places the file at /llms.txt or at any subpath, such as /docs/llms.txt. Since version 2 of the proposal (August 2026) a file covers the URLs under its own path, and where several files apply, clients are expected to use the most specific one. This lets a project that controls only part of a host, such as a project site under a shared domain, publish a file for its own pages. The proposal does not use /.well-known/, and there is no llms.txt entry in the IANA registry. Some documentation platforms serve a second copy under /.well-known/ as well; Mintlify, for example, documents both addresses. The only address the proposal itself defines is the one under the covered path. See what llms.txt is.
Metadata without a path of its own
Structured data has no site-wide file. JSON-LD is written into a script element in each HTML page, and a crawler sees it only when it fetches that page. The same is true of robots meta tags and canonical links, which belong in the head of each document. For files that have no head, such as PDFs, text files and Markdown versions of pages, the equivalent signals travel as HTTP response headers: X-Robots-Tag for indexing rules and Link for canonical and alternate URLs. See Page-level rules: the robots meta tag and X-Robots-Tag and canonical and alternate links.
Checking what each host serves
Request each file by its full address on every host and look at the status line and Content-Type. A HEAD request is enough to see both.
curl -sI https://example.com/robots.txt
curl -sI https://docs.example.com/robots.txt
curl -sI https://example.com/.well-known/security.txt
curl -sI https://example.com/llms.txtCheck the status code as well as the content. Under RFC 9309, a robots.txt request that ends in a 4xx response means the file is unavailable and the crawler may access anything, while a 5xx response or a network failure means the crawler must assume everything is disallowed until the file can be read. Media types, encodings and status codes for each format are set out in serving site files: media types, encoding and status codes.
See also
- Machine-readable files a website can publishThe files and markup a site publishes for crawlers, search engines, language model tools and security researchers: what each one is for, where it lives and which document defines it.
- Serving site files: media types, encoding and status codesWhich Content-Type each machine-readable file should be served with, why UTF-8 matters, and how crawlers react to redirects, client errors and server errors when they request robots.txt.
- robots.txt syntax: groups, rules and matchingReference for the robots.txt file format as standardized in RFC 9309: groups and user-agent lines, allow and disallow rules, the * and $ characters, comments, and the longest-match rule that decides which line applies to a URL.
- How crawlers find a sitemapA sitemap only helps once a crawler knows where it is. The Sitemap line in robots.txt, submission in Google Search Console and Bing Webmaster Tools, the retired ping endpoint, and IndexNow for announcing changed URLs.
- security.txt: publishing a security contactThe security.txt format defined in RFC 9116: where the file must be served, the two required fields Contact and Expires, the optional fields, signing, and the scope of a single file.
References
- Nottingham, M. RFC 8615: Well-Known Uniform Resource Identifiers (URIs). IETF, May 2019. rfc-editor.org
- IANA. Well-Known URIs registry. iana.org
- Koster, M., Illyes, G., Zeller, H. and Sassman, L. RFC 9309: Robots Exclusion Protocol, section 2.3. IETF, September 2022. rfc-editor.org
- Google Search Central. How Google interprets the robots.txt specification. developers.google.com
- sitemaps.org. Sitemaps XML format: Sitemap file location and Sitemaps and cross submits. sitemaps.org
- llmstxt.org. The /llms.txt file, v2.1. llmstxt.org
- Foudil, E. and Shafranovich, Y. RFC 9116: A File Format to Aid in Security Vulnerability Disclosure, section 3. IETF, April 2022. rfc-editor.org
- Mintlify documentation. llms.txt. mintlify.com