Windows 10: How to eliminate need for "localhost" prefix in Edge, localhosted site
I really mean the HOSTS file of Windows, not the Virtual Host configuation. My guess is that in Edge it will continue working without the entry from the HOSTS file, while it should then no longer work in all other browsers. If this is the case, then it means that Edge does not honor the HOSTS file at all. It then does not matter what you put in there; Edge will just ignore it.
Nope, that makes no difference. When I explicitly rem-out the localhost entry in the Windows HOSTS file, like this:
...then my sites run on Edge with the 'localhost/' prefix, and they run without the 'localhost/' prefix on Chrome, Firefox, even IE11, and all the other browsers.
In fact, I had put the "127.0.0.1 localhost" entry in the Windows HOSTS file without any need to, because at the top of the file, in the default commentary that Microsoft puts in the file explaining to the user how to use the file, there is found the following remarks by Microsoft:
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
So, Microsoft there is explaining it's unnecessary to have a 'localhost' entry for 127.0.0.1 in its HOSTS file, as that's handled internally by the OS. And that's why my localhosted sites continue to run in the fashion I've described.
Also, I tried to override the localhost definition by putting in a different one:
...but that doesn't work...the OS apparently ignores whatever definition you assign explicitly to localhost in the Windows HOSTS file and instead uses 127.0.0.1 exclusively, so there's never been a need for me even to have that definition in the Windows HOSTS file. (184.108.40.206 is the IP for Amazon.com, BTW...and I tried other IP addresses including nonsensical ones as well, so that pretty much proves it.)
How about setting up the current version of XAMPP, configuring as I described above (with the correct definitions in the HTTPD-VHOSTS.CONF as I corrected it above, with 'htdocs/' in between 'localhost/' and 'mysite/', etc.), and see if you don't get the same results I'm getting.
Thanks for clearing that up. This means, localhost is a special case, which makes it a bad example...
I have now tried configuring a few IPs in my HOSTS file, for example I set the IP of my router, gave it the name "router" and I now can open it using this name, also in Edge.
Okay, just to ensure I understand you, you mean that you can go to a locally hosted site just by putting the site name in the URL bar without prefixing it with 'localhost/', in other words, you can go to a site named 'router' by putting:
...in your URL bar in Edge, not:
Is that correct? If so, could you please share with me (i.e. post here) the settings you put in your Windows HOSTS file as well as the configuration in the XAMPP HTTPD-VHOSTS.CONF file so I can try to duplicate your result in Edge and the other browsers?
Entering the IP of my router inside the HOSTS file just was the first step for me to see, if Edge would generally obey the HOSTS file. It does. I can access the router now by simply typing "router", without "locahost/" in front of it, inside the address bar. Note however, that this router is in my local network, but it is not localhost.
I'll see, if I can get it running with XAMPP...
I eagerly upgraded from Windows 8.1 Pro to Windows 10 Pro on July 29 the moment I got the upgrade link.
But to my horror Edge is not working, WiFi drivers aren't working, nVidia Graphic drivers are corrupted. Somehow managed to install the other...
Is there a setting to turn this irritating popup off? In Internet Explorer there was an option to turn this off.
Read more: Google owned format support now reaches Microsoft Edge
I have upgraded 5 machines and clean installed 3 machines.
Experienced an issue with one machine with continuous corruption problems
After the 3rd attempt I discovered that even with a Clean Install of Win 10 I get unrepairable errors - Sorry...