diff --git a/app/WillySoft/Http/Route.php b/app/WillySoft/Http/Route.php index 48ae9fa..4e3c527 100644 --- a/app/WillySoft/Http/Route.php +++ b/app/WillySoft/Http/Route.php @@ -17,13 +17,13 @@ abstract class Route )) return; // check if the route matches and add parameters if any - // TODO: this is just really messy man wtf - if (!isset($_SERVER['PATH_INFO'])) { - $_SERVER['PATH_INFO'] = '/'; + $request_path = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['PHP_SELF']); + if ($request_path === '') { + $request_path = '/'; } $args = []; $path_parts = explode('/', $path); - $request_path_parts = explode('/', $_SERVER['PATH_INFO']); + $request_path_parts = explode('/', $request_path); for ($i=0; $i < count($path_parts); $i++) { if (empty($path_parts[$i])) { continue;