Here is my problem: I own many domain names (too many my wife says
) and I want to be able to do serve .NET pages for potentially each of them, but I don't want to have an account for each domain name. Essentially I want the users not to know that they are using the same application on a server for different domains. I don't want to redirect either as the urls will give it away.
I'm sure many other domain junkies must have this same issue. To achieve this I do the following:
Firstly I use Brinkster.com as my domain host. The allow up to 100(!) domains to point to the same application. That is step 1. Not many other hosts will allow that. Please comment if you know about other hosts that do.
Secondly I use a an httphandler to interrupt all my root .aspx requests. This handler then uses an xml file that I've created to match a domain with a folder in my website. Then I use fairly basic string manipulation to rebuild the request url. Finally I use:
IHttpHandler hand = (Page)PageParser.GetCompiledPageInstance(physicalFile, null, context); // For .NET 1.1
or
IHttpHandler hand = BuildManager.CreateInstanceFromVirtualPath(physicalFile, typeof(Page)) as IHttpHandler; //For .NET 2.0 with Medium Trust Level
hand.ProcessRequest(context);
to "run" the new url.
This works like a treat and the users are none the wiser. If you don't believe me check out my personal website, photography website and Boesmansriviermond (my town). All are running from the same brinkster account.
It be happy to get into specifics if anyone is interested. Please email me at adam[lastname - begins with an H]@hotmail.com.