summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/index.php b/index.php
index 5e5e92d..4cbfc09 100644
--- a/index.php
+++ b/index.php
@@ -3,12 +3,15 @@ include('./includes/head.php');
$page = strtok($_SERVER['REQUEST_URI'], '/');
-if (!empty($page) && $page[0] >= '0' && $page[0] <= '9') {
+
+if (empty($page)) {
+ include('./includes/render_index.php');
+} else if (!empty($page) && $page[0] >= '0' && $page[0] <= '9' && is_readable("./posts/$page.php")) {
include("./posts/$page.php");
-} else if (!empty($page)) {
+} else if (!empty($page) && is_readable("./posts/$page.php")) {
include("./pages/$page.php");
} else {
- include('./includes/render_index.php');
+ include('./includes/404.php');
}
include('./includes/foot.php');