Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I notice two types of design used in web applications, some with a particular subdomain for users contents, and some with same URL structure for all the accounts.

Ex: unique.domain.com and another_unique.domain.com for subdomains for sites like blogspot, wordpress, basecamp etc.

while in the other approach domain.com/action1 and domain.com/action2 the content is shown according to the user logged in, but the URL is same for every user.

What are main differences between both of these kind of design?

share|improve this question
1  
Belongs on webapps.stackexchange.com –  JB King Dec 11 '12 at 15:43
    
@JBKing Sorry, didn't know about that, how do I move this? –  Sathish Manohar Dec 11 '12 at 15:44
    
There should be a way for the moderators to move the question, though in the meantime, take a look on that SE and see if this has already been asked in a slightly different form. –  JB King Dec 11 '12 at 15:46
    
when you use a specific subdomain for static stuff (scripts and css) then a (malicious) user can preempt it (it happened to deviantart.com once) –  ratchet freak Dec 11 '12 at 16:00

1 Answer 1

up vote 5 down vote accepted

The server-side differences vary quite a bit from platform to platform.

In most cases, however, it is easier to write an application that assumes it runs in the root (at least in PHP and ASP.NET it is) and then set up separate sites/virtual directories for each.

From a user's perspective, telling them to go to mysite.example.com is typically easier to remember than www.example.com/mysite. There is no reason this must be so, but most people have it more or less ingrained to ignore everything after the / or, for that matter, before the main domain. As a more esoteric example, if you were to tell end users to go to ww2.host.example.com/mysite what most people will actually remember is example.com, their minds discarding the "trash".

The downside is, of course, that provisioning subdomains is kind of manual out of the box. You can script it up, of course, but in IIS or Apache, as well as most domain registrars it tends to be done by hand. So, you have to go to the effort of automating that (though I am sure there are some extant tools that do the trick).

share|improve this answer
1  
I'm using rails, it seems I can do some routes.rb trickery to dynamically use subdomains. Thanks for the insight :) –  Sathish Manohar Dec 11 '12 at 15:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.