Elmar le Grange Elmar le Grange - 1 month ago 20
C# Question

IIS binding prefixes localhost

Is there a way to set up a binding in iis in the format of:

website1.localhost:80

website2.localhost:80

website3.lcoalhost:80

etc

I set the websites up to use different ports but there is a resource that is needed which is hosted on port 80 on the same server. The other websites are now looking for this resource, assuming it runs on the same port as them (example :8001, :8002, :8003)

Answer

In your IIS Manager, go to Edit Bindings... of your website and add a site binding with website1.localhost as host name on the port 80. Next, edit the file c:\Windows\System32\drivers\etc\hosts to append an entry:

127.0.0.1       website1.localhost

Repeat the same above steps with other websites and you can naviate to http://website1.localhost/, http://website2.localhost/...