diff --git a/system/CodeIgniter.php b/system/CodeIgniter.php index f84561af4052..b1999158a112 100644 --- a/system/CodeIgniter.php +++ b/system/CodeIgniter.php @@ -223,7 +223,7 @@ public function run(RouteCollectionInterface $routes = null) // Save our current URI as the previous URI in the session // for safer, more accurate use with `previous_url()` helper function. - $this->storePreviousURL($uri); + $this->storePreviousURL($this->request->uri ?? $uri); unset($uri);