page: http redirect to html symlinks
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 31 Jul 2018 18:17:20 +0000 (20:17 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 10 Aug 2018 23:27:44 +0000 (01:27 +0200)
Feature to set up shorthands and replacements.

page.php

index e83a5853f355b25579fc1e2e208673be225e8674..070742643481a29ad0a818a6173841e690b7fdfd 100644 (file)
--- a/page.php
+++ b/page.php
@@ -136,6 +136,12 @@ while (TRUE) {
 $staticpage = NULL;
 if (file_exists("$Page$Args.html")) {
        $staticpage = "$Page$Args.html";
+       if (is_link($staticpage)) {
+               $target = readlink($staticpage);
+               header("HTTP/1.1 302 Shorthand");
+               header("Location: $target");
+               exit;
+       }
 }
 elseif (file_exists("$Page$Args/index.html")) {
        $staticpage = "$Page$Args/index.html";