Questions Hosting and Domains 2 min read

When should I use a subdomain vs. a path (blog.myapp.com OR myapp.com/blog)?

What is the difference between a subdomain and a path in practice? How do you decide when to use each?


Here are two ways a URL can be organized: blog.myproject.com (a subdomain) and myproject.com/blog (a path).

blog.myproject.com puts "blog" before the domain, making it a subdomain — a separate site. myproject.com/blog puts "blog" after the domain, making it a path — a section of the same site. blog.myproject.com myproject.com/blog subdomain path a separate site a section of the same site

A path is a section of the same website. myproject.com/blog and myproject.com/shop share one domain, so they’re parts of one site. Usually one server or app handles all of them, and the path just tells it which page to show. Sometimes that’s a folder, a static site might have an about folder for /about for example.

A subdomain is a separate site that shares your name. blog.myproject.com has its own address (its own DNS record), so it can point to a completely different server if desired. For example, your blog can run on WordPress while shop.myproject.com runs on an e-commerce platform. They’re built and deployed separately and don’t need to coordinate.

Subdomains are also used like this: foursixninesix.substack.com. Each newsletter gets its own “home” inside the larger Substack platform and is seperated by users. The technical term is multi-tenancy, in case you ever see your coding agent mention it.

How to decide

  • Use a path when it’s one product that should work together, different sections of the the same app. A blog that’s part of your marketing site is a common use case for a /blog path.
  • Use a subdomain when it’s a different sub-system or a different tech stack. a different tool from a different company, or when each customer gets their own space.

One practical difference: a login on myproject.com carries over to every path automatically. Between subdomains, it takes extra setup, because browsers treat them as separate “origin” domain.

hosting deploying dns