I am trying to develop an asp.net site with multiple subdomains. I am new to web sites in general, and asp.net in particular. However, it seems that wildcard subdomains are properly setup with a combination of dns entries and web server configuration - which isn't going to happen on my development machine. Therefore I'm manually inserting entries in my windows hosts file:
127.0.0.1 localhost
127.0.0.1 abc.localhost
127.0.0.1 xyz.localhost
However, when I try to interrogate the Request.Url property there is no subdomain to be seen. For example, if I hit http://abc.localhost:1660/
in the browser I get http://localhost:1660/
from Request.Uri.ToString()
; the abc
is just gone?!
I don't know why the hosts file works like this, but is there any other method I can use to get subdomains into my local web application? Thank you all.
Note that I'm only using the built-in asp.net development server rather than a full iis server. (I can't get access to a full IIS this weekend, but I would still like to know if that would help.)