summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
author53hornet <atc@53hor.net>2021-12-11 11:26:18 -0500
committer53hornet <atc@53hor.net>2021-12-11 11:26:18 -0500
commit00d6a7d10f6267e437b330aa99df091bfc7c67b6 (patch)
treeb3ffb8fc4f09933ebc8ed9c90f03412250199dd8 /index.php
parentde9bbfdb8f0d3b366e76a5cc775690f7315c740f (diff)
download53hor-routing.tar.xz
53hor-routing.zip
chore: organize pages and use router/renderer, organize assetsrouting
Diffstat (limited to 'index.php')
-rw-r--r--index.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/index.php b/index.php
index 2781c7a..bb6cfa9 100644
--- a/index.php
+++ b/index.php
@@ -1,8 +1,12 @@
<?php
include('./includes/head.php');
-if (($post = strtok($_SERVER['REQUEST_URI'], '/')) && !empty($post)) {
+$page = strtok($_SERVER['REQUEST_URI'], '/');
+
+if (!empty($page) && $page == "posts" && ($post = strtok('/')) && !empty($post)) {
include("./posts/$post.php");
+} else if (!empty($page)) {
+ include("./pages/$page.php");
} else {
include('./includes/render_index.php');
}