Skip to content

Put the Allow lines before the Disallow in robots.txt - #75

Merged
jnahian merged 1 commit into
mainfrom
fix/robots-rule-order
Sep 6, 2026
Merged

jnahian merged 1 commit into
mainfrom
fix/robots-rule-order

Conversation

@jnahian

@jnahian jnahian commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Follow-up to #73, fixing a bug in it.

The AI-crawler group led with Disallow: /. An RFC 9309 parser takes the longest match, so Allow: /llms.txt still wins there — but a first-match parser reads the Disallow and stops, denying the two paths the group exists to open.

Checked against Python's urllib.robotparser:

/llms.txt /docs/reading/
Disallow first (as merged) DENY DENY
Allow first (this PR) ALLOW DENY

/docs/reading/ staying denied is the point — the block is still doing its job.

The .md line depends on * and $ being understood. Those are Google extensions, supported by the crawlers named here; a parser without them opens llms.txt and skips the .md files. That's a degradation, not a break, and there's no wildcard-free prefix that covers /docs/*.md without also opening the HTML.

Still outstanding, and not fixable in this repo

Cloudflare's Managed robots.txt is on, and prepends its own block to this file. The live file therefore has two groups for GPTBot, ClaudeBot, CCBot and Bytespider (Cloudflare's Disallow: / first, then ours) and two User-agent: * groups.

Under longest-match semantics the merged groups resolve our way. Under first-match semantics Cloudflare's blanket Disallow: / wins for those four, regardless of this fix — PerplexityBot, which Cloudflare doesn't name, is allowed either way. Verified against the live file.

The clean resolution is to turn off Cloudflare's Managed robots.txt so this file is the only one, moving the Content-Signal: search=yes,ai-train=no,use=reference declaration into it to preserve that policy. That's a dashboard change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JGMQ49hvA936om3GQfNTAn

The AI-crawler group led with `Disallow: /`, which an RFC 9309 parser handles
fine — it takes the longest match, so `Allow: /llms.txt` still wins — but a
first-match parser reads the Disallow and stops. Checked against Python's
urllib.robotparser: every path denied, including the two the group exists to
open. With the Allow lines first, /llms.txt is allowed and /docs/reading/ is
still denied, under both readings.

The .md line still depends on `*` and `$` being understood. Those are Google
extensions, supported by the crawlers named here; a parser without them opens
llms.txt and skips the .md files, which is a degradation rather than a break.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JGMQ49hvA936om3GQfNTAn
@jnahian
jnahian merged commit 95819fd into main Sep 6, 2026
1 check passed
@jnahian
jnahian deleted the fix/robots-rule-order branch September 6, 2026 19:55
@jnahian jnahian self-assigned this Sep 6, 2026
@jnahian jnahian added the web The marketing site under web/ (and the docs pages it renders) label Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

web The marketing site under web/ (and the docs pages it renders)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant