diff --git a/app/router.php b/app/router.php index ceaa25c..c4e61dd 100644 --- a/app/router.php +++ b/app/router.php @@ -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);