getContext()->getRequest()->getRequestUri(); $path = (string)parse_url($uri, PHP_URL_PATH); if (SITE_DIR !== "/" && str_starts_with($path, SITE_DIR)) { $path = "/" . substr($path, strlen(SITE_DIR)); } if (str_ends_with($path, "index.php")) { $path = substr($path, 0, -9); } return $path === "" ? "/" : $path; } }