From b75ec5aba8cc950793b5616b8fbcc8f3f1697094 Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 28 Oct 2017 12:43:49 +1300 Subject: [PATCH] fix not applying redirects in the new URL format --- lib/template.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/template.php b/lib/template.php index 98c085f..b588b89 100644 --- a/lib/template.php +++ b/lib/template.php @@ -183,7 +183,14 @@ function redirecthtml($target) { function buildredirects($redirects) { foreach($redirects as $oldname => $newname) { - $page = redirecthtml($newname.'.html'); + + $page = redirecthtml(BASEURL.$newname.'/'); + + // old format file_put_contents(BASEDIR.'wwwroot/'.$oldname.'.html', $page); + + // new format + mkdir(BASEDIR.'wwwroot/'.$oldname); + file_put_contents(BASEDIR.'wwwroot/'.$oldname.'/index.html', $page); } }