Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoindex does not generate trailing "/" in URLs for directories #60

Open
hb9cwp opened this issue Oct 10, 2015 · 1 comment
Open

autoindex does not generate trailing "/" in URLs for directories #60

hb9cwp opened this issue Oct 10, 2015 · 1 comment

Comments

@hb9cwp
Copy link

hb9cwp commented Oct 10, 2015

httpd in OpenBSD 5.7 with "directory auto index" generates trailing slashes "/" in the HTML text output ">brA/", but not in the corresponding URLs (href="brA"), see example page below:
... <a href="brA">brA/</a> 02-Mar-2008 16:15 - ...

When the user clicks on those relative URLs, browsers attempt to fetch files, instead of directories. httpd responds with 301 Moved Permanently and redirect browsers to http://site.com/pfstat/brA/.

If auto index would append trailing slashes also to the URL, then that would save such redirects (actually two redirects when using SSL with HSTS, the first is a 301 to http://site.com/pfstat/brA/, and then second a 307 to https://site.com/pfstat/brA/).

Is this correct by design, or an oversight/bug?

<!DOCTYPE html>
<html>
<head>
<title>Index of /pfstat/</title>
<style type="text/css"><!--
body { background-color: white; color: black; font-family: sans-serif; }
hr { border: 0; border-bottom: 1px dashed; }

--></style>
</head>
<body>
<h1>Index of /pfstat/</h1>
<hr>
<pre>
<a href="..">../</a>                                                07-Oct-2015 16:26                   -
<a href="brA">brA/</a>                                               02-Mar-2008 16:15                   -
<a href="brB">brB/</a>                                               13-Apr-2008 10:35                   -
<a href="fwA">fwA/</a>                                               02-Mar-2008 15:50                   -
<a href="fwB">fwB/</a>                                               13-Apr-2008 10:35                   -
</pre>
<hr>
</body>
</html>
@cnst
Copy link

cnst commented May 14, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants