page: strip html suffix from symlink redirects
[minimedit.git] / page.php
index 070742643481a29ad0a818a6173841e690b7fdfd..8979e6298d0d7c7d45a961264af9ce5a84182685 100644 (file)
--- a/page.php
+++ b/page.php
@@ -137,7 +137,7 @@ $staticpage = NULL;
 if (file_exists("$Page$Args.html")) {
        $staticpage = "$Page$Args.html";
        if (is_link($staticpage)) {
-               $target = readlink($staticpage);
+               $target = preg_replace('/\.html$/', '', readlink($staticpage));
                header("HTTP/1.1 302 Shorthand");
                header("Location: $target");
                exit;