From 13ec8bd8a13a3dc70e52f67342f17161993b4b6c Mon Sep 17 00:00:00 2001 From: Jonathan Nessier Date: Tue, 21 Feb 2023 23:24:17 +0100 Subject: [PATCH] Fixed #9 --- index.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 335c284..fa00330 100644 --- a/index.php +++ b/index.php @@ -10,7 +10,12 @@ require_once 'options.php'; -$requestUri = str_replace($relativeUri, '', $_SERVER['REQUEST_URI']); +$requestUri = $_SERVER['REQUEST_URI']; +$position = strpos($requestUri, $relativeUri); +if ($position === 0) { + $requestUri = substr($requestUri, strlen($relativeUri)); +} + $requestUriPath = parse_url($requestUri, PHP_URL_PATH); $code = 404;