0

I have two websites on local IIS (ver 8):

\Website1 (Binding: http:*:80:)
  Index.html
\Website2 (http:*:80:anotherwebsite.com)
  Index.html

Is there a way to browse locally IIS website Website2? Browsing anotherwebsite.com is wrong - DNS will point me to the "public" anotherwebsite.com. Browsing localhost/anotherwebsite.com is also wrong - this will browse Website1.

I cannot change hosts file - this change has to be quick and easy (used for deployment heartbeat). I also don't want to add another binding (possible solution would be to add binding http:*:123: to Website2 and browse localhost:123.

piotrwest
  • 2,098
  • 23
  • 35

1 Answers1

2

The only way is to get your web-browser to connect to localhost but to spoof the Host header. Fortunately there are Chrome and Firefox extensions to do this. Search online for "chrome extension spoof host-header" (or Firefox). There are no extensions yet available for MS Edge.

Another option is to use the venerable Fiddler tool, which is a local HTTP proxy that works on every web-browser and lets you change any outgoing headers too: fiddler: how to disable overwrite Header Host

Community
  • 1
  • 1
Dai
  • 141,631
  • 28
  • 261
  • 374
  • Thank you! This works perfectly. If somebody is wondering if just setting HttpWebRequest.Host works - yes it does. – piotrwest Jan 11 '16 at 15:56