Can't open local IIS site in IE or Edge
Asked Answered
M

12

49

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

Mccary answered 14/9, 2015 at 11:25 Comment(1)
I don't think IIS or the app pool have anything to do with it. I have the same problem using Apache 2. #32385071Wheaton
S
95

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"

Sirup answered 19/4, 2016 at 16:45 Comment(6)
YES! This is the correct answer for Windows 10. I figured it was blocked only in Edge because all other browser worked. I also found that "about:flags" has this checkbox so you can turn it on through the UI.Gonophore
For official documentation on this, see "Frequently Asked Questions - Microsoft Edge Development" -- "How can I debug localhost?".David
@Brain2000, the above command may still have to be run, even if about:flags has the Allow localhost loopback option set, that is, said option under about:flags is not equivalent to the CheckNetIsolation command.David
This still didn't work in my case. I've set the option in about:flags, and added the loopback exemption from an elevated command prompt. Using Windows 10, and I've verified the minimum builds and versions for Windows 10, Microsoft Edge, and EdgeHTML. Edge prompts me for authentication when bring up a local site, but after 3 attempts I get a 401 error. These steps may work for Windows 10 Pro but I wonder if anyone has had luck with Windows 10 Enterprise?Yuma
2020 update: FAQ page is missing. Wayback machine yielded the following for how-can-i-debug-localhost faq: How can I debug localhost? > Microsoft Edge allows localhost access by default but treats “localhost” as an Internet site, so Intranet features like integrated authentication are disabled. Some custom host mappings might require additional configuration (more on that here) for which you can run the following command: CheckNetIsolation LoopbackExempt -a -n="Microsoft.MicrosoftEdge_8wekyb3d8bbwe"Zolly
This worked for me. However, I had to run the command in the answer. Checking the "Allow localhost loopback" option in about:flags did not work. They do not appear to change the same setting.Cavalier
C
17

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!)

Chromonema answered 9/11, 2015 at 19:16 Comment(3)
this worked for me, but you need to add the "click Sites button" step after the step 3Cacomistle
Windows 10 blocks edge for local sites automatically. None of this works.Gonophore
can't see local sites and that was already checked when I did these stepsImagine
W
8

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
Wheaton answered 10/10, 2015 at 8:5 Comment(9)
Hi Evan, thanks for the answer. Unfortunately I don't have anything in my trusted sites listMccary
man I was so excited too. I'm disappointed it didn't work for you. Did you try the suggestions here: #30334789Wheaton
Yeah tried all those suggestions, no joy. I put it down to my work computer settings - they have all sorts of proxy and isa rules so I reckon they are messing with edge. tbh, I find it stupid that a browser can't do the primary thing it is made for without having to mess with settings and run loads of commandsMccary
Thanks @Evan. I have a one word domain for my local test site (http://mysite). I tweaked various settings (I'm afraid I can't remember what they were now but there was a checkbox somewhere that said 'allow one word domain names'). But all with no success. Finally Edge could access my site when I removed it from the Trusted Sites list. This is very counter-intuitive.Siderolite
@Siderolite Glad it helped. Oddly for me, it stopped working after some time. Then this work fixed it for me: #30334789 but that eventually stopped working too. I now have it working again but I don't really know how/why.Wheaton
I was poking around the windows registry the other day on a Lenovo Thinkpad, and I noticed there were some "trusted sites" in the registry that never show up in the internet settings dialog, particularly lenovo.com. I haven't tested if this contributed to the issue but it is suspicious and worthy of checking imoWheaton
Wow, this really worked for me. But I have also done the "Check the 'Automatically detect intranet network' box" suggestion. So maybe it's a combination.Interlineate
I am not setting any domain , so running my site looks like localhost:8321 but still it says Hmm, we can't reach this page. even the network trace shows : 401 please helpDeciare
This only worked for me after I went back into 'Sites' and checked "Automatically detect intranet network'. I also have 'Allow localhost loopback' checked in the Edge about:flags and have my domain name added to the etc/hosts fileOutsmart
R
4

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!!!

Rhoda answered 27/11, 2019 at 7:55 Comment(0)
C
2

Internet Options / Local intranet sites

This works for me:

Carmelo answered 27/9, 2016 at 8:52 Comment(1)
Looked at the picture in your included hyperlink. Perhaps more details would be helpful. How do I navigate to this particular dialog box?Sterne
T
1

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

Tarbox answered 14/9, 2015 at 16:47 Comment(6)
Hi Shaun, thanks for answering. Unfortunately the names I am using do include a dot: test.local and dev.local - both fail to work in edgeMccary
Both of those work on my machine. What I can do is inspect my settings further and post further details until we understand it.Tarbox
There must something wrong with my settings as I can't find any information about this - the only other posts also suggest using FQDNs too - although the second link in my edit above suggests that you should just use ie11. But I refuse to believe I can't test with edge (although wouldn't put it past microsoft)!Mccary
Hmmm, I'm running exactly the same environment as you, apart from maybe my app pool is running under my work account (as per my edit above)Mccary
I'm using FQDN and I have this issue. Also, I am using Apache so I don't think IIS or app pools have anything to do with the problem.Wheaton
I am not setting any domain , so running my site looks like localhost:8321 but still it says Hmm, we can't reach this page. even the network trace shows : 401 please helpDeciare
S
0

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...

Scaremonger answered 14/7, 2017 at 12:21 Comment(1)
This answer actually looks really interesting to me. I wish I was still having the problem so i could try this. I wonder if my solution above mimics step #5 of your solution, which maybe explains why it worked for me. @NaNonthasen do you know why this solves the problem? Or was it just trial and error that led you to this? I think this looks like a good solution.Wheaton
M
0

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.

Morelock answered 17/10, 2018 at 15:43 Comment(0)
S
0

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.

Scope answered 3/3, 2020 at 10:45 Comment(0)
P
0

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.

Plight answered 16/9, 2021 at 5:35 Comment(0)
E
0

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/

Elis answered 29/12, 2023 at 17:14 Comment(0)
D
-1

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...

Deciare answered 18/8, 2017 at 5:53 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.