Add trailing slash redirect for list routes
This commit is contained in:
parent
0901d6324c
commit
7782eefa96
1 changed files with 6 additions and 0 deletions
|
|
@ -82,6 +82,12 @@ switch ($parsedPath['type']) {
|
|||
case 'list':
|
||||
$dir = $parsedPath['path'];
|
||||
|
||||
// Redirect to add trailing slash if needed
|
||||
if (!$ctx->hasTrailingSlash) {
|
||||
header('Location: ' . rtrim($_SERVER['REQUEST_URI'], '/') . '/', true, 301);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Check for page content files in this directory
|
||||
$pageContent = null;
|
||||
$contentFiles = findAllContentFiles($dir);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue