Skip to content

Instantly share code, notes, and snippets.

@smockle
Created October 29, 2013 18:04
Show Gist options
  • Save smockle/7219649 to your computer and use it in GitHub Desktop.
Save smockle/7219649 to your computer and use it in GitHub Desktop.
Use custom domains in IIS.
  1. Open %USERPROFILE%\My Documents\IISExpress\config\applicationhost.config
  2. Search for "virtualDirectory".
  3. Append <binding protocol="http" bindingInformation="*:<port>:dev.example.com" /> to the bindings section.
  4. In an admin terminal, run netsh http add urlacl url=http://dev.example.com:<port>/ user=everyone
  5. Open %SystemRoot%\system32\drivers\etc\hosts as an admin.
  6. Append 127.0.0.1 dev.example.com to the hosts file.
@andrewbranch
Copy link

In IE, protected mode must be off for the hosts file to be respected.

@smockle
Copy link
Author

smockle commented Aug 19, 2015

Visual Studio 2015 places applicationhost.config in a .vs folder in the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment