tags:

views:

191

answers:

3

I would like to simulate that my ASP.NET application is hist by say simdomain.com.

How can i do that easily?

Ideally I would like some kind of filter, so requests to certain domains are routed to localhost, and it should be easy to turn it on and off.

+3  A: 

Edit the hosts file.

  1. Run notepad c:\windows\system32\drivers\etc\hosts
  2. Add the following line:

    127.0.0.1 simdomain.com

  3. Open IIS admin and add a "simdomain.com" website. So it knows the domain.

chakrit
A: 

Maybe have a read of this SO discussion; "ASP.NET Development server or localhost IIS"

Pace
A: 

Try editing you local hosts file. The default location is %SystemRoot%\system32\drivers\etc\hosts in most Windows systems.

Then you simply add the line

127.0.0.1       simdomain.com

That should do it.

EDIT: Ah, and as Chakrit said: Open IIS admin and add a "simdomain.com" website. So it knows the domain.

This depends a bit on IIS version, but if I remember correctrly for IIS7 do as follows:

  1. Run 'inetmgr', or access the IIS setings via the Control Panel.
  2. In the menu on the left open 'Sites', and right-click on the site you want to access. Choose 'Edit bindings..'
  3. Click add. Type: Http, IP Address: All Unassigned, Port: 80, Host name: simdomain.com then click OK.

Might as well make my answer correct, even if the post is a tad redundant. ;)

Marcus L
About "Open IIS admin" - the point for me is to have a multi-domain site, so i don't think I need to do that - perhaps for cross-domain javascript of cookies?(Dont have it quite working jet - at a ping level. - Olav)
Olav
No, you need to add a "listener" to the site in IIS, otherwise it won't pick up on requests. I'll add how you do that to my responce.
Marcus L