fix not applying redirects in the new URL format

This commit is contained in:
mappu 2017-10-28 12:43:49 +13:00
parent 657d5ccd31
commit b75ec5aba8
1 changed files with 8 additions and 1 deletions

View File

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