Score:1

Use relative parent directory links in Apache httpd mod_autoindex

in flag

With Apache httpd mod_autoindex, the generated index pages use relative (without the leading slash) links for individual entries, for example:

    <a href="failure/">failure/</a>

The "parent directory" link is absolute (includes the leading slash), though:

    <a href="/project/2023-08-23/">Parent Directory</a>

Such behaviour breaks parent directory links in a reverse proxy setup. This has been observed on Apache httpd 2.4.6. Can the parent directory link be made relative with native httpd configuration (without rewriting the URL)?

HBruijn avatar
in flag
I don't think mod_autoindex has an option for that. This Q&A has some useful approaches though: https://stackoverflow.com/q/9718284/2952385
in flag
Thanks, skimming those answers discusses removal of "parent directory" - any particular answer that would discuss the relative/absolute link?
Score:0
in flag

Taking a closer look, this might not be technically feasible. A relative path in a subdirectory would be appended to the subdirectory.

For example, it would lead to incorrect paths like "/project/2023-08-23/project/". This link could be "..", which works on Linux, but it might have other problems, especially cross-platform - and is not natively supported anyway.

For reverse proxying, rewriting this path in the generated HTML pages with mod_proxy_html might be the best option.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.