GlossarySEO
Is a subdomain or a subdirectory better for SEO?
Also called: subdomain vs subfolder, blog.example.com vs example.com/blog, subfolder
Definition
A subdomain is a separate host like blog.example.com; a subdirectory is a folder like example.com/blog. Google can rank both. Subdirectories are usually simpler to run and keep everything in one site.
Subdomain vs subdirectory, explained
The debate is old and the honest answer is that both work. Google's own multi-regional guidance lists subdomains and subdirectories side by side as valid structures, with different trade-offs: subdomains are easy to set up on separate servers but users may not recognize what they mean; subdirectories are low maintenance and share one host. Google hasn't said that one ranks better than the other.
The practical differences are about operations and consolidation. A subdirectory lives on your main hostname, so it shares one Search Console Domain property view, one robots.txt, one sitemap setup, one favicon, and internal links that clearly connect it to the rest of the site. A subdomain is a separate host: it needs its own robots.txt and sitemap setup, and Google shows one favicon per hostname. That separation is useful when the content genuinely is a different thing, like an app, a status page, a community forum or docs on another platform.
Startups usually end up with subdomains by accident: a blog on a hosted platform at blog., docs on a docs tool at docs., a help center at help.. That's fine, but make sure each one links back to the main site and each is set up properly, with sitemaps, canonicals and robots rules. If you have the choice for core marketing content like a blog, a subdirectory keeps everything on one site with less setup.
Moving between them later is a site migration: map URLs, 301 them and update links.
Why it matters for founders
Where your blog and docs live affects how much setup you maintain and how clearly they connect to your product. Get it right before you've published hundreds of posts.
Example
Your blog runs on a hosted CMS at blog.example.com. You proxy it to example.com/blog through your CDN, 301 the old URLs, and manage one sitemap and one Search Console view.
Common mistakes
- Believing either option is a guaranteed ranking win.
- Subdomains with no links back to the main site.
- Forgetting each subdomain needs its own robots.txt and sitemap.
- Moving between them without a redirect plan.
Sources
- Google Search Central: Managing multi-regional and multilingual sites
- Google Search Central: Define a favicon to show in search results
Checked
Related terms
- Site architectureSite architecture is how a website's pages are organized and linked: the hierarchy of sections, the URL structure and the internal links between them. Good architecture helps crawlers and people find every important page quickly.
- Site migrationA site migration is any change that moves many URLs at once: a new domain, a new URL structure, HTTPS, or a new CMS. Done right, permanent redirects carry rankings to the new URLs.
- ccTLDA ccTLD is a two-letter country-code top-level domain, like
.de,.fror.uk. Google treats most as a strong signal that a site targets that country; some, like.ioand.ai, it treats as generic. - Search Console propertyA Search Console property is the site you verify and view data for. A Domain property covers every subdomain and protocol and needs DNS verification; a URL-prefix property covers only URLs starting with one exact prefix.