Pete
Pete

Reputation: 58412

Can't open local IIS site in IE or Edge

I have a site set up locally to do development on it and I have added it to iis and edited my host file with the url (see below). However, when I browse to the url I only get the "hmm, we can't reach this page" message.

The site works well in all other browsers including ie 11 so I was wondering if there are any settings to get local sites to work on edge.

I have been searching and could only find this related post, but the accepted answer on that makes no difference to me as the option is already checked on my edge. I have also tried the rebooting and flushing my dns but both didn't work.

I am using windows 10 and iis version 10 build 10240

Hosts File

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost
127.0.0.1       localhost loopback     # tried with and without this as thought it may have something to do with the loopback option in edge
127.0.0.1       test.local
127.0.0.1       dev.local

Other links I have managed to find - no solutions though and the second one seems to suggest that we just use ie11:

Why does Microsoft Edge open some local websites, but not others, where the domain name is routed to 127.0.0.1 in hosts file

https://social.technet.microsoft.com/Forums/en-US/246298d8-52c1-4440-8d7f-05329d50e653/edge-browser-hosts-file?forum=win10itprogeneral

Update

Could it be something to do with the fact the site app pool is running under my work account instead of IIS or Network services (I cannot run under the latter 2 as they don't have the correct privileges to browse certain folders on my computer)

Update 2

For anyone coming to this who has tried everything below. I have found out it may be something to do with my windows 10 installation - My first install on the machine was windows 8. I then upgraded this to 8.1 and the up to 10 when that came out.

Having had issues with a few other things, I bit the bullet and did a completely fresh install of windows 10 and voila, everything works perfectly!

May be a bit drastic, but if all else fails...

Update 3

I recently got a new work machine and had this problem all over again, tried everything but still couldn't get it to load - turns out that the work proxy was causing the issue so if you try everything below and have a proxy, check the proxy is not blocking it

Upvotes: 49

Views: 63572

Answers (12)

user20874661
user20874661

Reputation: 7

Try to see if iis10 has a bind to local network IP via Power Shell run as Admin:

C:\netsh http show urlacl.

Add http/s port 80 for local host IP address if not shown. Delete any ports that don't exist cause errors events system log. Set browser security for Intranet zone to allow local network or anonymous logon if no logon prompts on web page.

winrm quickconfig

winrm enumerate winrm/config/listener

Delete bad listener IP's/ports showing in event log as system errors (red dots):

WinRM Delete WinRM/Config/Listener?Address=IP:n.n.n.n+Transport=HTTP

netsh http (add/delete) iplisten

Delete any bad port bindings: netsh http>delete urlacl http://*:5358/

Upvotes: 0

BBaysinger
BBaysinger

Reputation: 6987

For IE specifically, on this page...

I found an answer similar to others, but a slightly different command:

CheckNetIsolation LoopbackExempt -a -n=windows_ie_ac_001

...As admin, like the other solutions.

I don't know if I found a different answer because I was searching for Internet Explorer specifically, but it worked anyhow.

Upvotes: 0

Joee
Joee

Reputation: 2016

I faced this error when i try to run my application locally using IISExpress. I have changed below configuration it fixes the issue.

Go to IISExpress config file which you will probably found in Documents-->IISExpress-->config--> applicationhost.config

Move the NTLM provider value above Negotiate like this

<windowsAuthentication enabled="false">
  <providers>
    <add value="NTLM" />
    <add value="Negotiate" />
  </providers>
</windowsAuthentication>

It fixes my issue. And i was able to browse my application with out any error in microsoft edge.

Upvotes: 0

Nitika Chopra
Nitika Chopra

Reputation: 1405

Follow these steps:-

Step 1: Run Command Prompt as Administrator

Step 2: Write command "CheckNetIsolation LoopbackExempt -a -n="Microsoft.MicrosoftEdge_8wekyb3d8bbwe"" and press enter. It returns OK.

Step 3: Restart Microsoft Edge or Internet Explorer to view your web page

I hope, this helps you.

Thanks!!!

Upvotes: 4

d.i.joe
d.i.joe

Reputation: 709

In addition to adding the hostname to the hosts' file, go to Internet Options and add the URL to the trusted sites under the Local Intranet. That works for me.

Upvotes: 0

Andy
Andy

Reputation: 187

This worked for me;

  1. Open the Internet Options dialog

  2. Go to the 'Security' tab

  3. Select the 'Local intranet' zone

  4. Click the 'Sites' button

  5. Check the 'Automatically detect intranet network' box

Edge can now find my local website (with a single word name!)

Upvotes: 17

N.K
N.K

Reputation: 2240

I tried all the options mentioned , but no success with IIS Express !!!

BUT

just a small thing i did (i don't know why) . and the stuff started working for me I deleted the entire .vs solution folder. which has the applicationConfig for solution , to be used with IIS Express ....

IT Worked !!! i am not sure if its the combination of above mentioned stuff and this file, or just this file...

Upvotes: -1

Na Nonthasen
Na Nonthasen

Reputation: 182

After you have tried all instructions or settings from other users but it doesn't work, try this:


Open Internet Options. (type "in" in "Search Windows/Cortana" if you using Win10)
1. select "Security" tab.
2. click on "Local intranet"
3. click "Sites" button.
4. Uncheck "Include all local (intranet) sites...."
5. Uncheck "Include all sites that bypass..."
- click "Advanced" button, remove all site address which defined in %windir%\System32\drivers\etc\hosts
6. & 7. OK
8. Restart Microsoft Edge or Internet Explorer.

try this...

Upvotes: 0

Sanjay10
Sanjay10

Reputation: 1767

The network is blocking loopback as a security measure in Windows 10, you need to make an exception by running this command for IE Edge in elevated privileges

CheckNetIsolation LoopbackExempt -a -n="Microsoft.MicrosoftEdge_8wekyb3d8bbwe"

Upvotes: 95

Mirek
Mirek

Reputation: 57

Internet Options / Local intranet sites

This works for me:

Upvotes: 2

Evan de la Cruz
Evan de la Cruz

Reputation: 1966

I figured it out and posted the answer over at my question: Why does Microsoft Edge open some local websites, but not others, where the domain name is routed to 127.0.0.1 in hosts file

(Assuming your issue isn't simply the loopback checkbox in about:flags)

The fix is to remove the domain names from your trusted sites list for the trusted zone. That's it. It took me two weeks to figure this out.

  1. Open the Internet Options dialog (just ask Cortana or use windowskey+s)
  2. Go to the Security tab
  3. Click on the Trusted Sites zone
  4. Click the Sites button
  5. Remove the troubled domain names from the trusted sites list
  6. Click Apply and then close the dialog
  7. Open Edge (or restart it if it is already running) and try your site

Upvotes: 8

Shaun Luttin
Shaun Luttin

Reputation: 141414

On my Windows 10 machine with Edge these are my results:

127.0.0.1       local             # Hmm, we can't reach this page
127.0.0.1       my.local          # Works :)
127.0.0.1       my.local.ca       # Works :)
127.0.0.1       test.local        # Works :)
127.0.0.1       dev.local         # Works :)

In your hosts file, use a fully qualified domain name (FQDN) instead of a nickname. In other words, include a dot. Then it will work in Edge.

my.local.ca renders in Edge.

My environment is also Windows 10 with IIS 10.0.10240.16384 installed.

IIS > Help > About IIS

And these are my settings within Windows Features > Internet Information Services > World Wide Web Services

Word Wide Web Services Settings

The Application Pool that I am using has its identity set to the account with which I log into my computer. It also works, though, when the identity is ApplicationPoolIdentity. In other words, both the EdgeHostsFile and the DefaultAppPool in the image below work on my machine.

Application Pools

And as you have already posted, my about:flags look like this with the allowance of the localhost loopback.

about:flags

My Edge version is 20.10240.16384.0

Edge Settings > Version

Upvotes: 1

Related Questions