Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

On shared web hosting, are all subdomains like foo.example.com and bar.example.com always hosted on the same server (same IP address)?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

They typically are. They're usually subdirectories within the root web directory or one level below that. Some hosts even let you choose where in your directory structure to put them.

share|improve this answer
    
Ok thanks and what about example.com? In which subdirectory is it? Is it directly in root web directory? –  Zistoloen Apr 17 '13 at 11:44
    
That is your main website so it's in your root web directory –  John Conde Apr 17 '13 at 11:45
    
Ok thank you John Conde! –  Zistoloen Apr 17 '13 at 11:47

Rather late, but this question came up in the sidebar and the accepted answer is not really correct.

Subdomains, as far as the Internet is concerned, are completely separate from each other. a.example.com and b.example.com can be hosted on the same server, on a different server, or on a different continent. It's just a question of how the DNS is set up. I have a few cases where the production www.example.com is at the provider and the new.example.com runs from the server on my desk.

How a provider sets up the file structure is entirely up to them. example.com/foo/ and example.com/bar/ is common, as is domains/foo.example.com/ and domains/bar.example.com/.

If you have VPS (virtual private server) with root access you can set it up any way you feel like, it's just a matter of putting the correct path in the webserver's config file.

share|improve this answer
    
While technically incorrect, it is functionally correct for the way most people view and acquire hosting. Yes, you can use DNS to have multiple servers handle the subdomains. But the average Joe gets a hosting account on a shared server and sets everything up there till he reads answers like this and starts thinking. –  Fiasco Labs Apr 27 at 17:44

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.