Search code examples
web-applicationswebsubdomainsitemap

Using subdomains versus internal folders?


I'm wondering how to organize and set up my business website in terms of subdomains, etc. I have a few sub-functions/services of the business. The main business website is "www.mybusiness.com". But I need custom web apps and a separately developed site for each sub-function of the business, because there are considerably different requirements going into each. Let's say there are 3 services my business provides : design, delivery, marketing.

What's the best way to organize this (for site visitors)? I could either let them access each sub-functions using subdomains, like this:

  • design.mybusiness.com
  • delivery.mybusiness.com
  • marketing.mybusiness.com

or this:

  • www.mybusiness.com/design/
  • www.mybusiness.com/delivery/
  • www.mybusiness.com/marketing/

I have a leaning towards subdomains - I think they look better, but which option is actually better? Are there pros and cons with respect to speed, efficiency, programming, etc? Are there any trade-offs? I have a virtual hosting plan from my hosting company, so getting subdomains shouldn't be a problem for me.


Solution

  • Sub-domains can be problematic if for example you want a single login for each user to work across them. This link explains the problems. It's not too hard to code, but if you're dealing with third party apps it may become complicated. Sub-domains can cause similar problems if you're using AJAX to fetch data between them, for example.

    (An easy solution to avoid cookie problems with sub-domains is to create a sub-domains that simply redirect to the internal folder; so purely a landing page.)

    A benefit to using sub-domains is sometimes it is easier to set up an application, particularly if it uses mod-rewrite to re-write URLs. Having multiple apps that re-write URLs on the same domain can become tricky.

    So both options have pros and cons, it probably doesn't make much difference. Either way there may be teething problems getting all the apps to work side by side. Saying that, you may not have any problems at all with either method. And I'm sure there are plenty of workarounds, often well documented, for any problems you'd encounter.

    However, it may be best to check all your apps work side by side before you spend too much money on preparing stationary with the URLs.