oupala / apaxy

a simple, customisable theme for your apache directory listing
https://oupala.github.io/apaxy/
GNU General Public License v3.0
1.86k stars 256 forks source link

links rewritten to //uri when in root level #100

Closed commonpike closed 5 years ago

commonpike commented 6 years ago

If you apply this on a domain root (https://mydomain.com/) the little javascript in footer.html rewrites the links to start with // instead of slash, causing the browser to go to, for example, //README.md, which becomes https://README.md which doesn't exist.

I just disabled that whole javascript for now. I think .. apache is removing the trailing slash already

Otherwise, tis a beauty, thanks!

rivermont commented 6 years ago

Nice find. I don't have this in root so I can't test but I can see this getting bad somewhere.

harpreetsb commented 6 years ago

same for me

damianperera commented 6 years ago

This issue can be fixed by replacing the anchor href replacement code in footer.html's JS script (a.href) with the following snippet:

a.href = uri + '/' + a.getAttribute('href',2);

oupala commented 6 years ago

The file is now apaxy.js.

Should we apply the fix?

oupala commented 6 years ago

I'd like to see someone else confirm the bug, and the fix.

@jordanbancino would you kind to test that?

ghost commented 6 years ago

Yeah, no problem. I'll work on it later this week when I have time.

ghost commented 6 years ago

Ok. Here's what I found:

This bug is indeed a problem with my installation. As for the fix, unless I applied it wrong, it does not work. I will clone and install @damianperera's version later this week, as they seem to have fixed it, judging by the commit reference.

oupala commented 6 years ago

There may be a difference between different browsers. Can any of you tell which browser you are using?

Another issue (issue #80) mentioned different behavior between Firefox and Chrome.

ghost commented 6 years ago

I am using Chrome.

oupala commented 6 years ago

Issue #100 and issue #80 are the same.

Both fix are very similar.

oupala commented 5 years ago

The issue is fixed in the development branch a release will soon be published.