Do I need separate robots.txt rules for each subdomain?
99Visibility Research · Updated October 21, 2026 · 5 min read
Short answer
Yes. A robots.txt file only governs the exact host, protocol and port it is served from, according to RFC 9309 and Google's robots.txt guide. The file at example.com/robots.txt says nothing about docs.example.com, shop.example.com or blog.example.com. Each subdomain needs its own /robots.txt with its own rules for AI crawlers such as OAI-SearchBot, PerplexityBot and Claude-SearchBot.
Key takeaways
- Robots.txt applies per host, protocol and port, so every subdomain needs its own file at its own root.
- Rules on your main domain do not block or allow anything on docs, blog or shop subdomains.
- AI crawler rules are per bot: GPTBot controls OpenAI training use, while OAI-SearchBot controls ChatGPT search.
- A subdomain with no robots.txt file is generally treated as open to all crawlers.
- A firewall or CDN can still block an AI crawler that a subdomain's robots.txt allows, so test access on every host.
Why each subdomain needs its own robots.txt
Robots.txt is scoped to one host. RFC 9309, the Robots Exclusion Protocol standard, places the file at the top-level path of a service, and the rules apply to that service only. Google's robots.txt guide says the same: a file covers the host, protocol and port it sits on.
That means docs.example.com, blog.example.com and shop.example.com are three separate hosts. A crawler that wants a page on the docs subdomain requests https://docs.example.com/robots.txt. It never reads the file on example.com for that decision.
What this means for you: if you wrote careful AI bot rules on your main site, they stop at the main site. Your help center, store and blog each run on whatever their own file says, or on nothing. The next move is to list every host you serve and check each file on its own.
What a separate file means for AI bots
Each subdomain file needs the same per-bot thinking as your main file. AI crawlers are not one bot. OpenAI's crawler documentation says GPTBot governs training use and OAI-SearchBot governs whether pages appear in ChatGPT search, and that "each setting is independent of the others". Our digest of OpenAI's crawler documentation covers the full set.
The common mistakes on subdomains are predictable:
- A blanket AI block copied from somewhere. Blocking every AI user agent on your docs subdomain also removes it from ChatGPT search eligibility if OAI-SearchBot is in the list.
- Blocking GPTBot and assuming you are hidden from ChatGPT. You are not. Search eligibility depends on OAI-SearchBot.
- Expecting a token for Google AI Overviews. There is none. As explained in AI Overviews and Googlebot, Googlebot rules are the control there.
User-triggered fetchers behave differently. OpenAI says robots.txt rules "may not apply" to ChatGPT-User, and Perplexity says Perplexity-User "generally ignores robots.txt rules". Treat robots.txt as the index-time control, not a guarantee against every fetch.
A minimal file for a docs subdomain that allows search bots and opts out of OpenAI training might look like this:
User-agent: OAI-SearchBot
Allow: /
User-agent: PerplexityBot
Allow: /
User-agent: Claude-SearchBot
Allow: /
User-agent: GPTBot
Disallow: /
The per-bot robots.txt guide explains each token before you copy anything.
Edge cases that catch teams out
Host scoping is stricter than most people expect. These cases each count as a separate host under RFC 9309 and Google's guide:
- www and the bare domain.
www.example.comandexample.comare different hosts. If both serve pages, both need a file, or one should redirect to the other. - http and https. The same hostname on a different protocol is a different service.
- Non-standard ports.
example.com:8080is separate fromexample.com. - Vendor-hosted subdomains. A help center or store run by a third-party platform may serve a robots.txt you did not write. Check whether you can edit it at all.
- Staging and preview hosts. These often carry a blanket
Disallow: /. That is usually intended, but confirm it never ships to production.
A missing file is not a block. Under RFC 9309, if /robots.txt returns a 4xx status, crawlers may access the whole host. A docs subdomain with no file is open to every bot, including training crawlers you blocked elsewhere.
Path-level control still works inside each host. If you want an AI crawler on some sections of one subdomain but not others, see allowing an AI crawler on some pages but not others.
Robots.txt is only the first gate
A correct file on every subdomain does not prove AI crawlers can reach those hosts. OpenAI's help center says eligibility for ChatGPT search requires allowing OAI-SearchBot and confirming that your host or CDN allows traffic from OpenAI's published searchbot IP addresses. Both conditions apply.
Subdomains often sit behind different infrastructure. Your main site may run through one CDN while the shop runs on a commerce platform and the docs on another vendor. Each can have its own bot management settings, and any of them can return a 403 to a crawler your robots.txt allows.
This changed recently for some sites. From 15 September 2026, Cloudflare set Training and Agent crawlers to blocked by default on ad-displaying pages for new domains, new sites on existing accounts, and existing free-tier customers. A subdomain added after that date can behave differently from your older hosts without anyone editing a file.
What nobody outside the operator controls: whether an allowed, reachable page gets retrieved or cited. Access makes a host eligible. It does not decide the answer.
How to audit every host for AI bot rules
Run this once, then repeat it whenever a new subdomain launches.
- List every host. Include www, the bare domain, and every subdomain that serves public pages: docs, help, blog, shop, status, careers. Check DNS records and your sitemap index for hosts you forgot.
- Fetch
/robots.txton each one. Record the status code. A 4xx means open to all bots. A 200 means read the rules. - Resolve the rules per bot. For each host, note what OAI-SearchBot, GPTBot, PerplexityBot, Claude-SearchBot, ClaudeBot, Meta-WebIndexer and Googlebot are allowed to fetch. The step-by-step testing playbook shows how.
- Compare against intent. Decide which hosts should be in AI search. Docs and help content often should be, as covered in whether AI engines can cite your help center.
- Test real access. Request a sample page on each host as each AI crawler and record whether you get a 200, a 403 or a challenge page. The AI Crawler Checker does this and shows which crawlers the firewall turns away.
- Fix and standardise. Start new subdomains from a shared robots.txt template for AI bots so no host launches without rules.
Frequently asked questions
Does a Disallow on my main domain block my subdomains?
No. A robots.txt file only applies to the host, protocol and port it is served from. A rule at example.com/robots.txt has no effect on shop.example.com or docs.example.com. If you want a crawler blocked on a subdomain, that subdomain's own /robots.txt must say so. If the subdomain has no file, crawlers generally treat it as fully open.
Can I redirect every subdomain's robots.txt to one central file?
RFC 9309 says crawlers should follow redirects when fetching robots.txt, so a redirect can work. It adds a failure point, though, and each crawler handles edge cases its own way. Serving a real file directly on each host is easier to verify. If you do centralise, test each host's /robots.txt as each AI crawler and confirm the rules that come back are the ones you meant.
Does blocking GPTBot on my shop subdomain hide it from ChatGPT search?
No. OpenAI's documentation says GPTBot governs training use only, and OAI-SearchBot governs whether pages appear in ChatGPT search. The settings are independent. To keep a shop subdomain eligible for ChatGPT search while opting out of training, allow OAI-SearchBot and disallow GPTBot in that subdomain's own file, then confirm your CDN lets OAI-SearchBot through.
What if a vendor hosts my help center or store subdomain?
Check whether the platform lets you edit robots.txt on that host. Some do, some serve a fixed file, and some sit behind their own bot management. Fetch the file, read the rules for each AI crawler, and test a real page request as each bot. If you cannot change a setting that blocks search crawlers, raise it with the vendor.
Sources
This page is AI-assisted. It was written from a verified evidence base and checked against our editorial policy. Engine behaviour changes often; facts are as of October 21, 2026.