Path confusion in XAMPP when running on Edge Browser

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Path confusion in XAMPP when running on Edge Browser

Postby TomXampp » 18. October 2015 04:03

I'm running a XAMPP localhost using the current version of XAMPP on Windows 10, and my sites run perfectly on all of the major browsers (Chrome, Firefox, Safari for Windows, even MSIE-11), except for Edge because of a certain quirk.

To access the sites (all properly housed in folders off of the xampp/htdocs directory), in Edge you must prefix the site name with "localhost/", so if your site/folder is named ABC, you have to put "localhost/ABC/" in the URL bar of Edge, not just "ABC/". This is unlike all the other browsers in which you simply put "ABC/" (and which therefore mimics the URL scenario of your live application).

I have all the Windows HOSTS file and the HTTPD-VHOSTS.CONF files configured correctly, for, as I wrote, my sites launch and run in all of the other major browsers (and as well under Windows 8.1). Specifically, the index.php file will launch, but navigation to different areas of the site that are in different files off of ABC or in its subfolders can't be found, as I'm using relative paths, something that only confuses Edge.

Has anyone else run into this problem and found a solution? Is there a solution in editing either the Windows HOSTS file or the HTTPD-VHOSTS.CONF file, or some other method?
TomXampp
 
Posts: 59
Joined: 12. March 2015 03:58
Operating System: Windows 8.1

Re: Path confusion in XAMPP when running on Edge Browser

Postby Altrea » 18. October 2015 07:26

We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Path confusion in XAMPP when running on Edge Browser

Postby TomXampp » 18. October 2015 08:26

No, my issue is not getting the localserver to run, it's the requirement for 'localhost/' to be prefixed before the name of the site in the URL, something not required by any other browser.

For clarity: XAMPP localhost malfunctions on Edge precisely because it insists on prefixing the named site with localhost, e.g. localhost/mysite/, not just mysite/.

For an example of the problem this causes, I have an htaccess MOD rewrite that directs info to /info.php. Because of the localhost/ prefix requirement, the site looks for info.php not in mysite/ but in the root, localhost/, causing the site to fail. This does not happen when the site is run from as live server. What can be done to eliminate the requirement for the prefix? This is a problem with Edge, not XAMPP.
TomXampp
 
Posts: 59
Joined: 12. March 2015 03:58
Operating System: Windows 8.1

Re: Path confusion in XAMPP when running on Edge Browser

Postby Altrea » 18. October 2015 14:45

no, your problem is not that you have to prepend http://localhost/. This just works for you because your project folders are saved inside the localhost DocumentRoot.

If you want to request just http://project/ (which is a TopLevelDomain URL) you will need a VirtualHost for that and this TopLevelDomain which routes back to your local computer (Loopback) will not work in Microsoft Edge. That is exactly the problem the two Links are talking about.
Microsoft has solved the problem with the TLD localhost, but (some) custom local TLDs doesn't seem to work.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Path confusion in XAMPP when running on Edge Browser

Postby TomXampp » 18. October 2015 16:56

Okay, let's make sure we're each on the same page. First, I'm using Windows 8.1 and Windows 10 (I have two different machines). The configurations are identical for XAMPP on each. And that means:

My C:\xampp\htdocs\ folder is shared with Administrator and with full permissions granted.

In C:\Windows\System32\drivers\etc\hosts I have:

Code: Select all
127.0.0.1       localhost
127.0.0.1       mysite1
127.0.0.1       mysite2


And in C:\xampp\apache\conf\extra\http-vhosts.conf I have:

Code: Select all
<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs"
    ServerName localhost   
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/mysite1"
    ServerName mysite1
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/mysite2"
    ServerName mysite2
</VirtualHost>


This allows me to run either localhost, mysite1, or mysite2 by putting in a browser's URL bar respectively:

Code: Select all
localhost/
mysite1/
mysite2/


On Edge, the Developer's Settings that are mentioned in the articles ("Use Microsoft Compatibility Lists" and "Allow Localhost Loopback") are both checked to be active (and were checked by default when I installed Windows 10 recently). Even so, I cannot access mysite1 or mysite2 without putting "localhost/mysite1/" and "localhost/mysite2/" into the URL.

Before going further, I want to make sure I'm not missing a setting in either the hosts file or the http-vhosts.conf file. Could you please confirm or deny that these files have the appropriate settings? If they do not, please tell me precisely what I need to add to them.
Last edited by TomXampp on 20. October 2015 00:11, edited 1 time in total.
TomXampp
 
Posts: 59
Joined: 12. March 2015 03:58
Operating System: Windows 8.1

Re: Path confusion in XAMPP when running on Edge Browser

Postby Altrea » 18. October 2015 17:02

TomXampp wrote:
Code: Select all
<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs"
    ServerName localhost   
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot "C:/xampp/mysite1"
    ServerName mysite1
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot "C:/xampp/mysite2"
    ServerName mysite2
</VirtualHost>

With this configuration you should not be able to access mysite1 or mysite2 by URL http://localhost/mysite1 or
http://localhost/mysite2. Not in Edge and not in other browsers.
http://localhost/mysite1 would request the ressource C:\xampp\htdocs\mysite1\

TomXampp wrote:Before going further, I want to make sure I'm not missing a setting in either the hosts file or the http-vhosts.conf file. Could you please confirm or deny that these files have the appropriate settings? If they do not, please tell me precisely what I need to add to them.

You cannot do any more in the Apache configuration. Anything else is OS, NIC and Browser configuration.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Path confusion in XAMPP when running on Edge Browser

Postby Nobbie » 18. October 2015 18:03

TomXampp wrote:I cannot access mysite1 or mysite2 without putting "localhost/mysite1/" and "localhost/mysite2/" into the URL.


Of course not, as your configuration is wrong. These URLS wont work in any browser.

TomXampp wrote:Could you please confirm or deny that these files have the appropriate settings? If they do not, please tell me precisely what I need to add to them.


You configuration is wrong, in case you want to enable "localhost/mysite1/" and "localhost/mysite2/" . In that case, you have the wrong understanding of VirtualHosts.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Path confusion in XAMPP when running on Edge Browser

Postby TomXampp » 18. October 2015 18:37

You are incorrect. I can, in fact, access mysite1 by putting

Code: Select all
http://localhost/mysite1


...into the URL bar of every browser. And yes, it resolves to C:\xampp\htdocs\mysite1. That is the expected behavior. It is also what happens if I simply put:

Code: Select all
mysite1/


...into the URL bar of every browser. That also resolves to C:\xampp\htdocs\mysite1. That is also the expected behavior.

In each case, the referenced site found in the mysite1 folder executes.

This is true for Windows7, 8.1, and 10 (except on Edge), and has been the case for years. The sole exception is Edge, which requires the 'localhost' prefix.

With all due respect, it appears you do not understand the issue. Do you use XAMPP? I ask because I cannot tell from your responses. Reproduce my XAMPP setup and you'll see that what I explain is true. Or please find someone who knows XAMPP who can reproduce these conditions. They do in fact work, and they have for me on all of my Windows machines for years.

The issue, again, is Edge's requirement for 'localhost' to prefix the site name (i.e. the folder name off of c:\xampp\htdocs\, e.g. c:\xampp\htdocs\mysite1).

Please re-read my previous post, and try it yourself on your own system. You'll see that it works. And then, please help me. I doubt I am the the first person to encounter this, and as more developers migrate to Windows 10, they'll want to test their websites using XAMPP on all the browsers, including Edge, and currently it has a quirk that prevents the expected behavior as detailed above.
TomXampp
 
Posts: 59
Joined: 12. March 2015 03:58
Operating System: Windows 8.1

Re: Path confusion in XAMPP when running on Edge Browser

Postby Altrea » 18. October 2015 19:29

TomXampp wrote:You are incorrect. I can, in fact, access mysite1 by putting

Code: Select all
http://localhost/mysite1


...into the URL bar of every browser. And yes, it resolves to C:\xampp\htdocs\mysite1. That is the expected behavior.

Not with the configuration you have shown us. In your virtualHost configuration mysite1 and mysite2 are outside of the localhost DocumentRoot.

<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/mysite1"
ServerName mysite1
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/mysite2"
ServerName mysite2
</VirtualHost>

And that is always the problem with fakedata here.


TomXampp wrote:With all due respect, it appears you do not understand the issue.

No, YOU don't understand that i have already given you the specific issue and that this is still a problem with Edge.

And now YOU should reread my posts.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Path confusion in XAMPP when running on Edge Browser

Postby Nobbie » 18. October 2015 20:36

TomXampp wrote:You are incorrect. I can, in fact, access mysite1 by putting

Code: Select all
http://localhost/mysite1


...into the URL bar of every browser. And yes, it resolves to C:\xampp\htdocs\mysite1. That is the expected behavior. It is also what happens if I simply put:

Code: Select all
mysite1/


But your VirtualHost Configuration shows us, that it should resolve to C:\xampp\mysite1 (without htdocs). Therefore i am out of this, i cannot debug invalid configurations and wrong descriptions.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Path confusion in XAMPP when running on Edge Browser

Postby TomXampp » 19. October 2015 23:58

If I were wrong, it wouldn't work on my systems as it has for years. Try setting it up on your system in XAMPP exactly as I have described and let me know if you can't get it to run that way; it should, because it's precisely how I've always had it set up, AND IT WORKS...that's the proof.

Further proof is that I cross-posted this issue on the WindowsTen forum, and the responder was able to duplicate my set-up and confirm what I was describing. He took the time to duplicate what I described; will you please do the same? (I believe you're reacting based on abstract principals of how you've set things up and how they've run on your system; you'd need to duplicate what I've done to see that it does work...I'm not making this up...this is how it's set up and how it's worked on XAMPP on many different Windows OS computers of mine for YEARS.)

Here's the cross-posting with the confirmation (read to the end of the thread to see the administrator was able to duplicate what I describe):

http://www.tenforums.com/installation-s ... post431324
TomXampp
 
Posts: 59
Joined: 12. March 2015 03:58
Operating System: Windows 8.1

Re: Path confusion in XAMPP when running on Edge Browser

Postby TomXampp » 20. October 2015 00:03

WOOPS...my error in the description of the HTTPD-VHOSTS.CONF file. I just caught the typo I made. You are right that it is reported wrong. This is the correct and actual configuration that I use (I had to type-up pseudo-code for illustration, and that's where the typo crept in):

Code: Select all
<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs"
    ServerName localhost   
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/mysite1"
    ServerName mysite1
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/mysite2"
    ServerName mysite2
</VirtualHost>


I simply neglected to include "htdocs" between "xampp" and "mysite1"/"mysite2" when I typed this up. Now I understand why you were reacting as you were. My oversight and my apologies.

I've gone back to the initial description of these directives and edited them to be correct. Again, my apologies for the oversight. I hope this will now help you help me figure out how to overcome this in Edge.
Last edited by TomXampp on 20. October 2015 00:15, edited 1 time in total.
TomXampp
 
Posts: 59
Joined: 12. March 2015 03:58
Operating System: Windows 8.1

Re: Path confusion in XAMPP when running on Edge Browser

Postby Altrea » 20. October 2015 00:14

TomXampp wrote:If I were wrong, it wouldn't work on my systems as it has for years. Try setting it up on your system in XAMPP exactly as I have described and let me know if you can't get it to run that way; it should, because it's precisely how I've always had it set up, AND IT WORKS...that's the proof.

I have tested that and you are simply wrong. I test all of the user configurations here posted just to be sure that it can be possible what the user describes here.
You think you have more knowledge about all that Apache configuration stuff than Nobbie and i and that is okay for me.
I have used XAMPP and Apache since XAMPP version 1.4.13 which was released 2005-04-10 and tried and used nearly all versions released since then at least for providing support. I administrate 4 industrial root Windows Webservers with Apache (in high availability) , two IIS Webservers and at minimum the same amount of development servers since 2007.
But maybe you are correct and you are knowing more about Apache configurating than i do. This is technically possible.
I am out now and wish you all the best solving your problem.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Path confusion in XAMPP when running on Edge Browser

Postby Nobbie » 20. October 2015 08:38

TomXampp wrote:I had to type-up pseudo-code for illustration, and that's where the typo crept in


And this shows up one of my main reasons, why i do not help on pseude-code any more (as i did earlier). Because in most cases the pseudo code hides the main problem or contains some other errors.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Path confusion in XAMPP when running on Edge Browser

Postby TomXampp » 20. October 2015 20:54

I hope that Altrea has seen this; I PM'd him to alert him that it was a typo in the pseudo code that was the source of the confusion in the explanation of the problem.

But the original problem remains:

In order to call up mysite1/ in Edge I have to prefix it with localhost/, like this:

localhost/mysite1/

That's the *real* question. I hope we can address this now that the issue of the errant httpd-vhosts.conf file code is cleared up. (Again, it was mistyped in my posting, not on my own system.)
TomXampp
 
Posts: 59
Joined: 12. March 2015 03:58
Operating System: Windows 8.1

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 152 guests