Subdomains or Subdirectories - which is better?

Discussion in 'General troubleshooting' started by jzahoor, May 28, 2009.

  1. I have a web-based app that servers multiple clients/companies. Let's call it www.myapp.com

    I want to:
    - have each client to be able to go to their own sign custom -in page with their own logo, company name etc
    - once they sign-in, it should take them to the "common" area that looks the same for all clients. This gives them the ability to have their own custom start page and still use the same app as everyone else

    Ok so I can accomplish this in 2 ways:
    1. give each client either a custom subdomain clientA.myapp.com and the Default.aspx in root will recognize the clientA part of the domain and render the appropriate company names and logo for that clientA
    OR
    2. create a subfolder for each client and give them www.myapp.com/clientA that has a custom Default.aspx page and redirects to root once a sign-in is successful.

    Option 2 seems like a maintenance nightmare. I also use cookies to keep auth-codes after a user signs in. Is better maintenance and easy url names the only real benefit of using subdomains?:confused:

    All users currently go to the same common, uncustomized page at www.myapp.com. Would my current code and use of cookies still be compatible with either of the 2 options or do I have to rethink that part of my code again (I'd rather not touch the cookies-related code at all).:(

    Thanks,

    Jimmy
     
  2. Yeah, option one does seem to be the much simpler way to go. Although option one will require that you purchase the 'Unlimited subdomain/unique IP' addon. Thats $5/month. But by doing this and redirect each subdomain to a specific subdirectory reduces the complexity of how you will pass the sessions from page to page.
     
  3. You could still do option 2 and use the ASP.NET VirtualPathProvider class - doing it this way means the subfolders for each client do not have to physically exist on disk thus eliminating the perceived maintenance problem and it might also make the urls cleaner / more readable.
     

Share This Page