47

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

Pete
  • 51,385
  • 23
  • 99
  • 140
  • I don't think IIS or the app pool have anything to do with it. I have the same problem using Apache 2. http://stackoverflow.com/questions/32384571/why-does-microsoft-edge-open-some-local-websites-but-not-others-where-the-doma/32828629#32828629 – Evan de la Cruz Oct 10 '15 at 07:24

10 Answers10

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"

Frank
  • 422
  • 1
  • 4
  • 21
Sanjay10
  • 1,757
  • 12
  • 8
  • 3
    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. – Brain2000 Aug 24 '16 at 17:35
  • Excellent, worked like a charm! You saved me many hours of troubleshooting. – bretcj7 Jun 07 '17 at 13:42
  • 2
    For official documentation on this, see ["Frequently Asked Questions - Microsoft Edge Development" -- "How can I debug localhost?"](https://developer.microsoft.com/en-us/microsoft-edge/platform/faq/#how-can-i-debug-localhost). – Mesagoma Jun 18 '17 at 01:53
  • 3
    @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. – Mesagoma Jun 18 '17 at 02:09
  • 1
    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? – Matt Sep 14 '17 at 16:09
  • 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"` – Danny Apr 15 '20 at 18:10
  • 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. – J.D. Mallen Sep 22 '20 at 00:09
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!)

Ian Kemp
  • 24,155
  • 16
  • 97
  • 121
Andy
  • 187
  • 5
9

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
Community
  • 1
  • 1
Evan de la Cruz
  • 1,912
  • 1
  • 12
  • 15
  • Hi Evan, thanks for the answer. Unfortunately I don't have anything in my trusted sites list – Pete Oct 12 '15 at 08:10
  • 1
    man I was so excited too. I'm disappointed it didn't work for you. Did you try the suggestions here: http://stackoverflow.com/questions/30334289/cant-open-localhost-in-microsoft-edge-project-spartan-in-windows-10-preview – Evan de la Cruz Oct 12 '15 at 08:44
  • 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 commands – Pete Oct 12 '15 at 09:12
  • 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. – Annabel Feb 04 '16 at 00:02
  • @Annabel Glad it helped. Oddly for me, it stopped working after some time. Then this work fixed it for me: http://stackoverflow.com/questions/30334289/cant-open-localhost-in-microsoft-edge-project-spartan-in-windows-10-preview?rq=1 but that eventually stopped working too. I now have it working again but I don't really know how/why. – Evan de la Cruz Feb 09 '16 at 10:53
  • 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 imo – Evan de la Cruz Mar 18 '16 at 00:19
  • 1
    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. – Branislav Kuliha May 31 '16 at 07:25
  • I am not setting any domain , so running my site looks like http://localhost:8321 but still it says Hmm, we can't reach this page. even the network trace shows : 401 please help – N.K Aug 18 '17 at 05:13
  • 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 file – Andy White May 12 '20 at 21:23
3

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

Nitika Chopra
  • 873
  • 9
  • 20
2

Internet Options / Local intranet sites

This works for me:

Mirek
  • 57
  • 6
  • Looked at the picture in your included hyperlink. Perhaps more details would be helpful. How do I navigate to this particular dialog box? – barrypicker Dec 23 '17 at 19:20
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

Shaun Luttin
  • 107,550
  • 65
  • 332
  • 414
  • 2
    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 edge – Pete Sep 15 '15 at 07:39
  • Both of those work on my machine. What I can do is inspect my settings further and post further details until we understand it. – Shaun Luttin Sep 15 '15 at 15:02
  • 1
    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)! – Pete Sep 15 '15 at 15:11
  • 1
    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) – Pete Sep 15 '15 at 15:18
  • 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. – Evan de la Cruz Oct 10 '15 at 07:23
  • I am not setting any domain , so running my site looks like http://localhost:8321 but still it says Hmm, we can't reach this page. even the network trace shows : 401 please help – N.K Aug 18 '17 at 05:11
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...

Na Nonthasen
  • 143
  • 2
  • 3
  • 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. – Evan de la Cruz Nov 16 '17 at 18:04
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.

d.i.joe
  • 160
  • 4
  • 17
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.

Joee
  • 1,104
  • 11
  • 15
-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...

N.K
  • 2,205
  • 1
  • 13
  • 36