How to get multiple ASP.NET web sites running on a single machine using the same default port.
Say I have myfirstsite, mysecondsite
Open your hosts file as administrator (UAC will only let you do this as admin).
On the machine I’m using (Windows 7) it’s C:\windows\system32\drivers\etc\hosts
Add the following lines:
127.0.0.1 myfirstsite 127.0.0.1 mysecondsite
In IIS for both myfirstsite and mysecondsite,
you’ll need to make sure the bindings bind to all IP addresses on port 80.
The HostName will probably need to be changed to the name of your website
In IIS 7 / 7.5 To add a host header entry for a Web Site in IIS 7 / 7.5
- Right click the Web Site.
- Click Edit Bindings…
- Click on http and click Edit…
- Type the host header in the text box “Host name:” and click OK.
If you still have the great joy of working with IIS 6.0
- Right click Web Site
- Click on Properties.
- Click Advanced… button in the Web Site tab
- Click on Default and click Edit…
- Type the host header in the text box “Host Header value:”
You should now be able to browse to http://myfirstsite and also http://mysecondsite using the default port 80
Leave a Reply