3 ms·
Ask HN: 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 3y agoA.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.
- codegeek 3y ago"whereas foo.com/A has to be on the same address as foo.com/B." Does it though ? I could always reverse proxy /B to another host, correct ?
- PaulHoule 3y agoIt is still going through one server if you reverse proxy. If everything is inside one data center it can perform pretty well but you will lose the performance benefits a CDN or something like that could bring to a subdomain.
- mattl 3y agoGitLab 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 3y agoper-origin security
- gndk 3y agoSEO. 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-best-practices-workers-part-1/ https://blog.cloudflare.com/subdomains-vs-subdirectories-bes...