Last post Mar 18, 2011 12:47 AM by Topspy
Mar 15, 2011 04:34 PM|ashsawant|LINK
I have been working mainly on intranet web sites so a little in-experienced with hosting public websites.
We have to build a new website which hosts customized HTML pages for different clients.
For eg. www.sample.com/client1, www.sample.com/client2, www.sample.com/client3, etc.
But as per requests from some clients the URL would be set up as client1.sample.com, client2.sample.com, etc.
I want to design an ASP.net web application that will work for both the scenarios. I will have a single database behind all these client websites which will provide the customized text per client.
Based on my reading i found that i can host the website one a single Public IP address and then map each of these registered DNS entries to this public IP. The website would use the ServerVariables["HTTP_HOST"] to extract the client name from the
URL to determine which client was requested and proceed with the formatting.
I would like to know some opinions on whether this is a good approach for designing the application. i haven't tried it but does ServerVariables["HTTP_HOST"] return the entire URL or will it work only for the sub-domains.
Also this web site will be added to Google Analytics and will need other Search Engine Optimizations. So i am not sure how this approach will affect the results there.
Any help is appreciated. Thank you in Advance
Mar 15, 2011 04:59 PM|Small Peter|LINK
I think this is a good approach. If you have used IIS, you know that you can bind different domain names in your case client1.example.com and client2.example.com to the same IP but to different sites. I am not sure for Google Analytics if they treat client1.example.com
and client2.example.com as two sites or one.
Mar 17, 2011 02:31 PM|matyvegan|LINK
u can bind a site with differents domains.
with google analytics in this case u need to register only 1 domain www.sample.com and then subdomains for this domain.
if u have for example with ur website diferent domains, people.sample1.com, people.sample2.com, people.sample3.com, u can register 3 domains: sample1.com, sample2.com, sample3.com, because this is the website and in ur case u have subdomains.
Mar 17, 2011 03:10 PM|ashsawant|LINK
But can i map www.domain.com/subfolder to that same IP as well? because i don't want to preferably create an actual folder for each client.
Mar 18, 2011 12:47 AM|Topspy|LINK
you can only map domain or subdomain to IP address (called A record), you can not map www.domain.com/subfolder to any IP address, the "subfolder" is only a subfolder under your main site www.domain.com. Of course you can put as many subfolders as you like
and develop different site for each of them.