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

I recently got a domain and set it up with Google Apps including setting up sub-domains for the different services.

After set up the CNAME, all my subdomains point to ghs.google.com. I was wondering how this works with all subdomains pointing to the same site.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Your browser sends a request to Google's server with the Host: yoursite.com header.

Google looks up this hostname in a (very large) database mapping hostnames to websites, then serves the corresponding website.

This database includes App Engine apps, Google Apps aliases, BlogSpot blogs, and other things.

share|improve this answer
    
OK, but if that is the case, surely the header must be 'subdomain.mydomain.com` otherwise how would it know whether to look up a Blog or and App. –  Saad Farooq Feb 27 '12 at 12:29
    
Try the live headers for firefox plugin and see whats being sent, but the process outline above is roughly how it works. –  toomanyairmiles Feb 27 '12 at 15:10
    
Thanks. Firefox is awesome. So I guess the Google servers must differentiate on the basis of the the Host name passed in the headers. Makes sense. –  Saad Farooq Feb 28 '12 at 1:55
add comment

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.