diff options
| author | horus | 2021-03-15 22:38:27 +0100 |
|---|---|---|
| committer | horus | 2021-03-15 22:38:27 +0100 |
| commit | 3ee4fc2d67dc3aecdb72ad39f23fb0ec3637cb08 (patch) | |
| tree | 257476f6b031a7bf88a06a6690b8fecc5a6081ac /public | |
| parent | 83fec0b53ae04e23948b981cf845ce0d476ba22a (diff) | |
| download | moehring-3ee4fc2d67dc3aecdb72ad39f23fb0ec3637cb08.tar.gz | |
Changes to trailing slash.
Diffstat (limited to 'public')
| -rw-r--r-- | public/index.php | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/public/index.php b/public/index.php index 7e44159..1de542e 100644 --- a/public/index.php +++ b/public/index.php @@ -9,24 +9,21 @@ switch( $url ) { case("/"): echo $twig->render('index.html'); break; -case("/about"): +case("/about/"): echo $twig->render('about.html'); break; -case("/projects"): +case("/projects/"): echo $twig->render('projects.html'); break; -case("/tools"): +case("/tools/"): echo $twig->render('tools.html'); break; -case("/tools/faces"): case("/tools/faces/"): echo $twig->render('tools/faces/index.html', [ "faces" => get_faces() ]); break; -case("/tools/pizza"): case("/tools/pizza/"): echo $twig->render('tools/pizza/index.html'); break; -case("/tools/untrack"): case("/tools/untrack/"): $_url = ""; if ( isset($_REQUEST['url']) ) { @@ -34,11 +31,19 @@ case("/tools/untrack/"): } echo $twig->render('tools/untrack/index.html', [ "url" => $_url ]); break; -case("/tools/zeitumstellung"): case("/tools/zeitumstellung/"): echo $twig->render('tools/zeitumstellung/index.html', [ "tc" => new Zeitumstellung() ]); break; +case("/tools/tanz/"): + echo $twig->render('tools/bpm/index.html', [ "dances" => get_dances() ]); + break; default: - http_response_code(404); - echo $twig->render('404.html'); + if ( str_ends_with($url, "/") ) { + http_response_code(404); + echo $twig->render('404.html'); + } else { + $url = $url . "/"; + header("Location: " . $url); + exit; + } } |
