diff --git a/add_url.php b/_wip_todo/add_url.php similarity index 100% rename from add_url.php rename to _wip_todo/add_url.php diff --git a/index_old.php b/_wip_todo/index_old.php similarity index 100% rename from index_old.php rename to _wip_todo/index_old.php diff --git a/router.php b/_wip_todo/router.php similarity index 100% rename from router.php rename to _wip_todo/router.php diff --git a/session.php b/_wip_todo/session.php similarity index 100% rename from session.php rename to _wip_todo/session.php diff --git a/style_minimal.css b/_wip_todo/style_minimal.css similarity index 100% rename from style_minimal.css rename to _wip_todo/style_minimal.css diff --git a/style_papermod.css b/_wip_todo/style_papermod.css similarity index 100% rename from style_papermod.css rename to _wip_todo/style_papermod.css diff --git a/style_pixelblog.css b/_wip_todo/style_pixelblog.css similarity index 100% rename from style_pixelblog.css rename to _wip_todo/style_pixelblog.css diff --git a/index.php b/index.php index 2ac6c63..a18c429 100644 --- a/index.php +++ b/index.php @@ -1,8 +1,10 @@ 'post.php', // matches only twtHash of exactly 7 alphanumeric characters ]; + // Loop through the defined routes and try to match the request URI foreach ($routes as $pattern => $action) { - if (preg_match('#^' . $pattern . '$#', $path, $matches)) { + if (preg_match('#^' . $base.$pattern . '$#', $path, $matches)) { // Extract any matched parameters (e.g., username) if(!empty($matches[1])) { @@ -46,6 +49,7 @@ foreach ($routes as $pattern => $action) { // If no matching route is found, handle as a 404 http_response_code(404); echo "