Skip to content

Subdomain vs subfolder

The most common places to host your documentation are

  • On a subdomain like docs.example.com
  • In a subfolder like example.com/docs

There’s a lot of debate in the SEO world about exactly how Google and other search engines will treat your documentation in each structure but the general consensus is that the second option is better for SEO.

Google will regard your marketing site and your documentation site as the same, so any ‘domain authority’ or other signals of ‘this is a good site that deserves to rank well’ will be shared across both.

Depending on your marketing site set up, the subfolder approach might be harder to set up.

If you’re hosting everything yourself and you are comfortable enough configuring URLs to have example.com/docs point at your documentation without having to have everything too closely coupled, then it’s worth doing this from the start, as migrating from a subdomain to a subfolder once you have a lot of internal links is challenging.

If it’s hard (e.g. you’re hosing your marketing site on WordPress or something that you have less control over), just use a subdomain and don’t stress too much about it. Google will rank good content highly anyway.