Using a string redirect (internal/external) $response->redirect("posts/index"); $response->redirect("http://www.google.com"); $response->redirect("http://www.example.com/new-location", false);
public function redirect($location, $temporarily = true) { if ($temporarily) { $message = 'Temporarily Moved'; $statusCode = '302'; } else { $message = 'Permanently Moved'; $statusCode = '301'; } $this->setStatusCode($statusCode, $message); $this->setHeader('Location', isset($this->url) ? $this->url->get($location) : $location); return $this; }