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 beween a subdomain and a path in practice? How do you decide when to use each?


The first one is called a subdomain, the second one is called 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

You can think of the path is part of the same website. It’s domain is same as the original website’s domain. It’s about organizing the content of the original website. For example, the server that hosts the website, may have a folder that matches the name of the path (e.g a folder named about for the /about path).

The subdomain is distinct from the original website. It’s domain is considered to be different from the original website. It’s for hosting different applications (could even be made with different tech stacks). For example, blog.myproject.com may contain a blog that is managed/hosted by wordpress vs. shop.myproject.com may point to your online store hosted/managed by some e-commerce platform. They are distinct and don’t need any coordination between them.

Contrast this with path, if you had myproject.com/blog and myproject.com/shop, both of those live on the same server and would need to work together.

Mark as read

Saving your progress arrives when the course opens. Get notified.

hosting deploying dns