Subdomains vs Subfolders: Which Should You Use?

Hosting, Security & Maintenance2 min readBy the Monopage team

When you add a new section to your site, such as a blog, shop, or help center, you must decide where it lives. You can place it in a subfolder (example.com/blog) or on a subdomain (blog.example.com). Both work, but they have different trade-offs.

What they are

  • Subfolder (or subdirectory): a path on your main domain, like example.com/shop
  • Subdomain: a separate name before your domain, like shop.example.com

To a visitor, both look like part of your brand. Technically, a subdomain is treated more like a separate site that you happen to control.

SEO considerations

Search engines have said they can treat subdomains as part of the same site or as separate sites depending on the situation, and that either structure can work. Many SEO practitioners prefer subfolders for content like blogs, because it keeps everything under one domain and builds a single set of signals. That preference is common advice, not a guaranteed ranking factor, and well-run subdomain setups also rank.

In practice:

When a subfolder is a good choice

See URL structure best practices.

When a subdomain makes sense

  • A web application, customer portal, or login area built on separate software
  • An online store on a separate platform, where hosting it under a path is impractical
  • A help center or documentation run by another service
  • A staging or test site. See what is a staging site
  • A part of a large organization that runs independently

Practical and technical differences

  • Hosting: subfolders usually come from one system. Subdomains can point to a different server, which is flexible. A reverse proxy can also serve another system at a subfolder path, if your host supports it
  • Cookies and security: cookies can be shared across subdomains in some configurations, which has security consequences. Keep sensitive apps separate and configure cookies carefully
  • HTTPS: each subdomain needs a certificate, or a wildcard certificate. See what is SSL and why HTTPS matters
  • DNS: subdomains need DNS records. See how DNS works for website owners

Changing later

Moving from a subdomain to a subfolder, or the other way around, is a migration that needs redirects and careful monitoring. Choose carefully now. See how to migrate a website without losing SEO and 301 redirects explained.

A simple rule

If the section supports your main site's content and brand, use a subfolder. If it is a separate system with its own purpose and software, a subdomain is fine.

Common mistakes

  • Putting a blog on a subdomain for no reason
  • Forgetting analytics on subdomains
  • Mixing both without a plan

A related choice affects your main address. Read www vs non-www: which to use.