diff --git a/src/App.php b/src/App.php index b3d140434c..eca441a13b 100644 --- a/src/App.php +++ b/src/App.php @@ -404,7 +404,13 @@ public function url($page = [], $needRequestUri = false) $result = []; if ($this->page === null) { - $this->page = basename($this->getRequestURI(), '.php'); + $uri = $this->getRequestURI(); + + if (substr($uri, -1, 1) == '/') { + $uri .= 'index.php'; + } + + $this->page = basename($uri, '.php'); } // if page passed as string, then simply use it