How to enable external request on IIS Express

If you put to your browser URL address which contains different server name/IP address then localhost. You will see error “Bad Request – Invalid Hostname” or information that page is not accessible. There are workaround how can you connect to your IIS Express from different computer in network.



Configure IIS Express

  1. Go to the folder “..\My Documents\IISExpress\config\” in your home
  2. Open file “applicationhost.config” in your favorite text editor
  3. Find lines (port number can be different)
         <binding protocol="http" bindingInformation="*:50280:localhost" />
  4. Rewrite localhost to *
  5. Lines should look like
         <binding protocol="http" bindingInformation="*:50280:*" />
  6. Save file and restart IIS Express

Reserve IIS Express URL for non-administrator accounts

  1. Run command line as Administrator
  2. Run command (modify port number by your IIS Express listening port)
    netsh http add urlacl url=http://*:50280/ user=everyone

Enable port on firewall

  1. Go to the “Control Panel\System and Security\Windows Firewall”
  2. Click “Advanced settings”
  3. Select “Inbound Rules”
  4. Click on “New Rule …” button
  5. Select “Port”, click “Next”
  6. Fill your IIS Express listening port number (in my case 50280), click “Next”
  7. Select “Allow the connection”, click “Next”
  8. Check where you would like allow connection to IIS Express (Domain, Private, Public), click “Next”
  9. Fill rule name (e.g “IIS Express), click “Finish”


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.