diff --git a/router.php b/router.php index 2f4644a..dd67aa5 100644 --- a/router.php +++ b/router.php @@ -20,8 +20,6 @@ if (preg_match('/\.(?:jpg|png|webp|css|ico|js|ttf|woff|txt)/', $_SERVER["REQUEST return false; } - - load_page($tryuri); @@ -80,12 +78,11 @@ function uri_from_file($file) { } function try_file($uri, $ext) { - - $tryf = "$uri/index"; - $tryuri = ltrim($tryf, '/'); + $tryuri = ltrim($uri, '/'); + $tryf = ltrim("$tryuri/index", '/'); if (is_file("$tryf.$ext")) return "$tryf.$ext"; - else if (is_file("$uri.$ext")) return "$uri.$ext"; + else if (is_file("$tryuri.$ext")) return "$tryuri.$ext"; }