Ответ 1
-
Остановить текущий запущенный сайт, если он запущен
-
Открыть
%userprofile%\documents\iisexpress\config\applicationhost.config
для VS2015 +:$(solutionDir)\.vs\config\applicationhost.config
-
Найдите интересующий вас сайт и привяжите его как
<binding protocol="http" bindingInformation="*:<your-port-number>:localhost" />
-
Теперь добавьте аналогичную запись
<binding protocol="http" bindingInformation="*:<your-port>:dev.www.mydomain.com" />
чуть ниже указанной записи bindig. -
снова запустите сайт
ПРИМЕЧАНИЕ. Вы должны запустить visual studio как администратор, поскольку привязка не-localhost требует прав администратора.
Обновление по Pure Krome:
В дополнение к этому нам нужно сделать следующее. Эти комментарии находятся в верхней части моего web.config(наряду с несколькими другими материалами...).
1) netsh http add urlacl url=http://localhost.www.foo.com:80/ user=everyone
netsh http add urlacl url=http://localhost.foo.com:80/ user=everyone
netsh http add urlacl url=http://localhost.foobar.com.au:80/ user=everyone
netsh http add urlacl url=http://localhost.pewpew.com:80/ user=everyone
... etc ...
NOTE: to remove a urlacl: netsh http delete urlacl url=<url in here> .. eg http://foo.com:80
2) ... and we need to edit the main IIS7 express config file to define the url which will be accepted, per web -site-
File: C:\Users\<UserName>\Documents\IISExpress\config\applicationhost.config
<bindings>
<binding protocol="http" bindingInformation="*:1200:localhost" />
<binding protocol="http" bindingInformation="*:80:localhost.www.foo.com" />
<binding protocol="http" bindingInformation="*:80:localhost.foo.com" />
<binding protocol="http" bindingInformation="*:80:localhost.foobar.com.au" />
<binding protocol="http" bindingInformation="*:80:localhost.pewpew.com" />
</bindings>