Subdomain vs subfolder

A subdomain is a separate host like blog.example.com; a subfolder is a path like example.com/blog. What Google documents about the differences between them.

A subdomain is a separate hostname under your domain, such as blog.example.com. A subfolder, also called a subdirectory, is a path on your main hostname, such as example.com/blog. The choice usually comes up when a business adds a blog, a shop or language versions to an existing site.

Google's documentation doesn't say that one of the two ranks better. It does document several practical differences:

  • Google's crawling infrastructure treats each hostname as a separate site with its own crawl budget, so a subdomain is crawled as a site of its own;
  • a robots.txt file is valid only for the host it is on, so a subdomain needs its own;
  • in Search Console, a Domain property covers all subdomains, while a URL-prefix property can show a single folder or subdomain on its own;
  • Google's guide to multi-regional sites lists easy setup, different server locations and easy separation as pros of subdomains, and easy setup and low maintenance on the same host as pros of subdirectories.

In practice the decision is about setup and upkeep. A subfolder needs either a CMS that hosts the section or a reverse proxy rule that forwards the path to another system. A subdomain needs only a DNS record, but it adds a second host to look after.

Related terms

Sources

  1. Managing multi-regional and multilingual sites
  2. Optimize your crawl budget
  3. How Google interprets the robots.txt specification
  4. Add a website or platform property to Search Console

All terms