Subdomain vs subfolder is the choice between putting a section of your site on its own host name, such as blog.example.co.uk, or in a folder on your main host, such as example.co.uk/blog/. Both can rank. The real differences are technical: robots.txt, Search Console, site names, cookies and how much work each one takes to run.
What is the difference? #
A subdomain is a label in front of your root domain. It makes a new hostname, which can point to a different server or app. A subfolder (also called a subdirectory) is part of the path after the host. It lives on the same host as the rest of the site.
| Subdomain | Subfolder | |
|---|---|---|
| Example | help.example.co.uk | example.co.uk/help/ |
| Host | A new host | The same host |
| robots.txt | Needs its own file | Shares the main file |
| Search Console | Inside a Domain property; needs its own URL-prefix property | Inside both property types |
| Site name in Google | Can have its own | Uses the domain’s |
| Cookies | Not shared unless the cookie names the parent domain | Shared on the same host |
| Server | Can be a different server or platform | Same server, or a proxy rule |
What does Google say about each? #
The Google documents we checked do not say that one ranks better than the other. They do describe how each is handled:
- robots.txt is per host. Google’s robots.txt specification says the rules apply only to the host, protocol and port where the file sits, and that a robots.txt on a subdomain is only valid for that subdomain.
- Search Console groups them differently. The Search Console help on adding a property says a Domain property covers all subdomains, protocols and subpaths, and must be checked with a DNS record. A URL-prefix property covers only addresses under that exact prefix.
- Site names stop at subdomains. Google’s site names guide says site names can appear for domain-level and subdomain-level sites, but are not supported at the subdirectory level.
- For countries, both are options. Google’s multi-regional sites guide lists subdomains as easy to set up, allowing different server locations and easy separation of sites. It lists subdirectories as easy to set up and low maintenance on the same host, with harder separation of sites. It marks URL parameters for country targeting as not recommended.
Why does it matter for search? #
Most of the risk comes from running two hosts as if they were one. Internal links, XML sitemaps, canonical tags and hreflang all have to point at the right host. A subfolder keeps one set of rules and one sitemap index. A subdomain gives you a clean break, which is useful when the section is truly a different thing, run by a different team or on a different platform.
A forgotten subdomain is a common leak. Google’s canonicalization guide lists a demo version of a site accidentally left open to crawlers as one cause of duplicate content. A staging site on staging.example.co.uk is exactly that.
Why does it matter for AI answers? #
robots.txt is a file per host for AI crawlers too, so a rule that blocks or allows GPTBot on your main site says nothing about your help subdomain. If you block AI crawlers or publish an llms.txt file, do it on every host you want covered. When you count citations, decide up front whether your subdomains count as your own site.
What about cookies and analytics? #
MDN’s Set-Cookie reference says a cookie with no Domain attribute goes back only to the host that set it, not to its subdomains. If a domain is named, the cookie is available to it and all its subdomains. So a basket or consent choice set on shop.example.co.uk may not carry over to example.co.uk unless it was set for the parent domain. Check your cookie banner and your analytics on both hosts.
When should you pick each? #
Choose a subfolder when the section is part of the same business and the same audience: a blog, guides, a help centre, a /uk/ or /ie/ version. One host, one robots.txt, one sitemap, one set of reports.
Choose a subdomain when the section must run on a different platform, needs its own server or location, is a separate product, or should stay apart: a status page, a developer portal, a staging site you lock down.
Common mistakes #
- One robots.txt for two hosts. Each subdomain needs its own.
- Only a URL-prefix property. You miss data from your other hosts. Add a Domain property too.
- Moving without redirects. Shifting a blog from a subdomain to a folder needs a 301 from every old address. See move a website without losing traffic and 301 vs 302.
- Staging left open. Put it behind a login and keep it out of search.
- Mixed links. Templates that link to both hosts for the same page create duplicate content.
- Certificates. Each host needs a valid SSL certificate.
A worked example #
A UK shop runs its main site on one platform and its blog on another, at blog.example.co.uk. It wants the blog in a folder.
- Set the blog to answer on example.co.uk/blog/ through a proxy, or move the posts.
- Map every old address to its new one, for example blog.example.co.uk/how-to-fit-a-chain/ to example.co.uk/blog/how-to-fit-a-chain/, as a 301.
- Update internal links, canonicals and the sitemap to the new addresses.
- Merge the blog rules into the main robots.txt, and keep a robots.txt on the old subdomain that does not block the redirects.
- Watch both hosts in a Domain property for a few months.
How to check it #
- Read each host’s rules with our Robots.txt Checker.
- Test old addresses after a move with the Redirect Checker.
- Check each host’s sitemap with the Sitemap Checker and certificate with the SSL Checker.
- Confirm the main page choice with the Canonical Checker, and language links with the Hreflang Checker.
- See what each host runs on with the Tech Stack Checker, and which AI bots it allows with the AI Bot Checker.
Questions #
Does a subdomain get its own authority? #
Google’s documents we checked do not answer this. Treat a subdomain as needing its own links and care.
Is www a subdomain? #
Yes, technically. See www vs non-www.
What about a separate country domain? #
That is a third option. See ccTLD and international SEO.
Related words #
Sources #
- Google Search Central: How Google interprets the robots.txt specification, checked 25 November 2026
- Search Console Help: Add a website property, checked 25 November 2026
- Google Search Central: Site names in Google Search, checked 25 November 2026
- Google Search Central: Managing multi-regional and multilingual sites, checked 25 November 2026
- Google Search Central: What is URL canonicalization, checked 25 November 2026
- MDN Web Docs: Set-Cookie header, checked 25 November 2026
Updated 25 November 2026 by URSY.
Cite this page: Subdomain vs subfolder. URSY. Updated 25 November 2026. https://ursy.com/wiki/subdomain-vs-subfolder/ · Section links
Tools for this
- LiveAI Readiness Checkeris your site ready for ChatGPT, Gemini, Claude? Score + fixesRun the check →
- LiveAI Bot Checkerwhich AI bots your robots.txt lets inRun the check →
- LiveRobots.txt Checker + Generatortest any address against your rules, or write new onesRun the check →
- LiveSchema Markup CheckerRun the check →