From 637b86f1a221f09d1cdfb35030b7ab056add422d Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 26 Jan 2025 14:02:48 +0200 Subject: feat(views): Implement a proper router --- apache/sites/nowayforward_human.conf.tpl | 10 +++--- views/global/footer.php | 16 ++++++++++ views/global/header.php | 35 +++++++++++++++++++++ views/global/router.php | 54 ++++++++++++++++++++++++++++++++ 4 files changed, 111 insertions(+), 4 deletions(-) create mode 100644 views/global/footer.php create mode 100644 views/global/header.php create mode 100644 views/global/router.php diff --git a/apache/sites/nowayforward_human.conf.tpl b/apache/sites/nowayforward_human.conf.tpl index ba010c7..2a5f58f 100644 --- a/apache/sites/nowayforward_human.conf.tpl +++ b/apache/sites/nowayforward_human.conf.tpl @@ -7,11 +7,13 @@ SetHandler "proxy:unix:${PHP_FPM_SOCKET}|fcgi://localhost/" - RedirectMatch "^/$" /home/index.php - RedirectMatch "^/index.html$" /home/index.php - RedirectMatch "^/index.php$" /home/index.php - RewriteEngine On + RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule .* - [e=HTTP_AUTHORIZATION:%1] + + RewriteCond %{REQUEST_URI} !/archives.* + RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f + RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d + RewriteRule ^(.*)$ /global/router.php diff --git a/views/global/footer.php b/views/global/footer.php new file mode 100644 index 0000000..22c4631 --- /dev/null +++ b/views/global/footer.php @@ -0,0 +1,16 @@ + + + + diff --git a/views/global/header.php b/views/global/header.php new file mode 100644 index 0000000..a00c528 --- /dev/null +++ b/views/global/header.php @@ -0,0 +1,35 @@ + + + + + + + + + <?= htmlspecialchars($title ?? "No Way Forward Human");?> + + + +
+ + +
+
diff --git a/views/global/router.php b/views/global/router.php new file mode 100644 index 0000000..8986dfe --- /dev/null +++ b/views/global/router.php @@ -0,0 +1,54 @@ +