diff options
| author | horus | 2022-12-01 18:23:30 +0100 |
|---|---|---|
| committer | horus | 2022-12-01 18:23:30 +0100 |
| commit | e431f223673f153d774241df470101c9036b7eb5 (patch) | |
| tree | 7c72d5344eef61f60b855bc3787b896b91e8f570 | |
| parent | 50d4fb0b931f9d3aa4780ae00ca6041d8ef1eef3 (diff) | |
| download | moehring-e431f223673f153d774241df470101c9036b7eb5.tar.gz | |
more structured, annotated routing with a few shortcuts
| -rw-r--r-- | public/index.php | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/public/index.php b/public/index.php index afae00a..957bed4 100644 --- a/public/index.php +++ b/public/index.php @@ -15,6 +15,9 @@ case("/about/"): case("/projects/"): echo $twig->render('projects.html'); break; +case("/feeds/"): + echo $twig->render('feeds.html'); + break; case("/thing/"): case("/tool/"): case("/tools/"): @@ -24,12 +27,28 @@ case("/tools/"): case("/things/"): echo $twig->render('things.html'); break; + +# things: + +## faces case("/things/faces/"): echo $twig->render('things/faces/index.html', [ "faces" => get_faces() ]); break; +case("/faces/"): + header("Location: https://" . $_SERVER["HTTP_HOST"] . "/things/faces/"); + exit; + break; + +## pizza case("/things/pizza/"): echo $twig->render('things/pizza/index.html'); break; +case("/pizza/"): + header("Location: https://" . $_SERVER["HTTP_HOST"] . "/things/pizza/"); + exit; + break; + +## untrack case("/things/untrack/"): $_url = ""; if ( isset($_REQUEST['url']) ) { @@ -37,18 +56,42 @@ case("/things/untrack/"): } echo $twig->render('things/untrack/index.html', [ "url" => $_url ]); break; +case("/untrack/"): + header("Location: https://" . $_SERVER["HTTP_HOST"] . "/things/untrack/"); + exit; + break; + +## tanz case("/things/tanz/"): echo $twig->render('things/bpm/index.html', [ "dances" => get_dances() ]); break; -case("/feeds/"): - echo $twig->render('feeds.html'); +case("/tanz/"): + header("Location: https://" . $_SERVER["HTTP_HOST"] . "/things/tanz/"); + exit; break; + +## zeitumstellung case("/things/zeitumstellung/"): echo $twig->render('things/zeitumstellung/index.html', [ "tc" => new Zeitumstellung() ]); break; +case("/zeit/"): + header("Location: https://" . $_SERVER["HTTP_HOST"] . "/things/zeitumstellung/"); + exit; + break; +case("/zeitumstellung/"): + header("Location: https://" . $_SERVER["HTTP_HOST"] . "/things/zeitumstellung/"); + exit; + break; + +## ghrss case("/things/ghrss/"): echo $twig->render('things/ghrss/index.html', [ "data" => get_ghrss_feeds() ]); break; +case("/ghrss/"): + header("Location: https://" . $_SERVER["HTTP_HOST"] . "/things/ghrss/"); + exit; + break; + default: if ( str_ends_with($url, "/") ) { http_response_code(404); |
