robots.txt Allow Directive
Explicitly permits compliant crawlers to fetch a specific subpath inside an otherwise Disallowed directory, governed by RFC 9309 longest-match precedence.
Verified
Syntax / Example
User-agent: * Disallow: /api/ Allow: /api/public/
Verify On A Live URL
curl -s https://example.com/robots.txt | grep -iE "^(user-agent|allow|disallow):"
Documented Facts For robots.txt Allow Directive
| Metric or Rule | Documented Value | Source |
|---|---|---|
| Conflict resolution rule | Longest matching path prefix wins (RFC 9309 §2.2.2) | RFC 9309: Robots Exclusion ProtocolChecked November 25, 2026 |
| Exact-length tie-breaker | Allow wins over Disallow on equal length | RFC 9309: Robots Exclusion ProtocolChecked November 25, 2026 |
| Group scoping | Applies only inside the single most-specific User-agent group | RFC 9309: Robots Exclusion ProtocolChecked November 25, 2026 |
Official Specification & Google Behavior
Under RFC 9309 §2.2.2, when both Allow and Disallow patterns match a URL, the rule with the longest matching character path wins; if both patterns are identical in length, Allow takes precedence over Disallow.
SEO & Indexing Impact
Lets publishers keep sensitive folders like /api/ blocked while opening public assets, OG images or public endpoints like /api/public/ cleanly.
Backlink Monitoring Verdict
Check longest-match precedence whenever a crawler or backlink auditor reports a blocked URL inside a mixed Allow/Disallow group.
Common Pitfalls
- Assuming rule order (top-to-bottom) decides precedence—RFC 9309 uses longest pattern match, not line order.
- Writing Allow: / inside a dedicated AI bot group without repeating private Disallow paths, accidentally exposing /admin/.
Frequently Asked Questions
- Does Allow or Disallow win when both match the same URL?
- Under RFC 9309, the rule with the longer matching path wins. If both rules have the exact same character length, Allow wins.
- Does the order of Allow and Disallow lines matter in robots.txt?
- No, compliant parsers evaluate by longest matching path length rather than which line appears first or last.
- Do I need Allow: / if I have no Disallow rules?
- No, everything is allowed by default unless matched by a Disallow rule, though explicit Allow: / improves human readability.
Primary Sources
Verified
- RFC 9309: Robots Exclusion ProtocolNovember 25, 2026
Related Research Guides
- October 30, 2026How To Block AI Crawlers In Robots.txt: Every Bot, Sorted By Job80% of AI crawling feeds model training. See how to block AI crawlers in robots.txt, bot by bot, with block rates and a file to copy.
- November 18, 202611 Technical SEO Checks Ranked By Indexing Impact: Status Codes, Crawl And CWVEleven technical SEO audit checks ordered by indexing impact—covering HTTP status codes, robots.txt leaks, 27.4-day indexing and Core Web Vitals.
- November 20, 2026How Google Search Works: Crawling, Indexing And Ranking In Numbers61.94% of 16 million tracked pages were not indexed. See how Google Search works: crawling, indexing and ranking, with Google's own numbers.