Icemanind
Icemanind

Reputation: 48686

Dynamic Host name in ASP.NET

How can I dynamically create a host name in ASP.NET? Like if people come to my site, I want to be able to dynamically create them a .Mysite.Com host name. I've seen this done at other sites before but can't seem to find documation on how to do it. Any help would be appreciated. I'm using VB.NET/ASP.NET 2008 and IIS 6.0

Upvotes: 2

Views: 1241

Answers (1)

dtb
dtb

Reputation: 217293

  1. Configure the authoritative DNS to resolve any subdomain to the same IP address
  2. Configure the web server at IP address to serve the same web site for any subdomain
  3. Use the HTTP_HOST environment variable to get the DNS name:
Request.ServerVariables["HTTP_HOST"]

Upvotes: 3

Related Questions