summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/index.php b/index.php
index 6a58209..44c56e4 100644
--- a/index.php
+++ b/index.php
@@ -169,7 +169,13 @@ if (!is_dir($root.'/'.$dirname)) {
echo "\t\t\t\t<tr class=\"".implode(' ', $classes)."\">";
echo "<td>";
- echo "<a href=\"".htmlentities($filename)."\">".htmlentities($filename)."</a>";
+ if (stat_is_dir($stat)) {
+ // stick a trailing slash on the URL; save a round-trip, since nginx will add it
+ // with a redirect
+ echo "<a href=\"".htmlentities($filename)."/\">".htmlentities($filename)."</a>";
+ } else {
+ echo "<a href=\"".htmlentities($filename)."\">".htmlentities($filename)."</a>";
+ }
if (stat_is_link($stat)) {
$target = readlink($root.'/'.$dirname.'/'.$filename);
echo " -&gt; <a href=\"".htmlentities($target)."\">".htmlentities($target)."</a>";