There are two main strategies for handling multiple "applications" on the web:
- subdomains (e.g. wiki.example.org, blog.example.org, admin.example.org, api.example.org/v1)
- subdirs (e.g. example.org/wiki, example.org/blog, example.org/admin, example.org/api/v1)
What are the differences (advantages and disadvantages) of these two solution when dealing with web programming (e.g. in terms of code organization, browsers security models, javascript etc).
Edit: CW as there's a correct answer, but it's very broad.
foo.example.com
, wherefoo
isn't specifically listed in DNS (see Wildcard DNS) but is used in a query on the web application, is patented in the United States despite its relative obviousness, so being able to switch to the second form if you get a licensing demand from the patent owner when using the first form would be very well worth the time.