fix not applying redirects in the new URL format
This commit is contained in:
parent
657d5ccd31
commit
b75ec5aba8
@ -183,7 +183,14 @@ function redirecthtml($target) {
|
|||||||
|
|
||||||
function buildredirects($redirects) {
|
function buildredirects($redirects) {
|
||||||
foreach($redirects as $oldname => $newname) {
|
foreach($redirects as $oldname => $newname) {
|
||||||
$page = redirecthtml($newname.'.html');
|
|
||||||
|
$page = redirecthtml(BASEURL.$newname.'/');
|
||||||
|
|
||||||
|
// old format
|
||||||
file_put_contents(BASEDIR.'wwwroot/'.$oldname.'.html', $page);
|
file_put_contents(BASEDIR.'wwwroot/'.$oldname.'.html', $page);
|
||||||
|
|
||||||
|
// new format
|
||||||
|
mkdir(BASEDIR.'wwwroot/'.$oldname);
|
||||||
|
file_put_contents(BASEDIR.'wwwroot/'.$oldname.'/index.html', $page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user