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); } }