HACKER Q&A
📣 paddw

A.foo.com vs. Foo.com/A


I feel like the former one has become much more popular recently. Why? AFAIK there is little practical difference, other than CORS being more of a problem with the former as well. Is it just aesthetics?


  👤 PaulHoule Accepted Answer ✓
A.foo.com can be served by a different IP address than B.foo.com whereas foo.com/A has to be on the same address as foo.com/B.

If you have different DNS names those functions can be on different servers using different technology. One could be in AWS, one in Azure, another on a mac in your office, another on a CDN, another could be some SAAS vendor operating under your brand.


👤 gndk
SEO. A subdomain is generally considered as a separate site. So having all content on the root domain increases its authority and thus rankings.

The Cloudflare blog has a good explanation: https://blog.cloudflare.com/subdomains-vs-subdirectories-bes...


👤 mattl
GitLab does it so that if you're not logged in, you get bounced from gitlab.com to about.gitlab.com but when you're signed in, you can access the app from gitlab.com without the need for any subdomain name for say app.gitlab.com or the like

👤 nektro
per-origin security