Open jroedel opened 5 years ago
There is an open todo in the class of the redirect plugin:
In the meantime you can use this workaround in any controller action:
public function indexAction()
{
$response = $this->getResponse();
$response->getHeaders()->addHeaderLine(
'Location',
'https://github.com'
);
$response->setStatusCode(301);
return $response;
}
This repository has been closed and moved to laminas/laminas-mvc; a new issue has been opened at https://github.com/laminas/laminas-mvc/issues/4.
I have changed my routing setup on a production app, and I would like to provide search engines with the information that a new URL format is being used. For this I would like to use code 301 (Permanently Moved) instead of 302 (Found).
Code to reproduce the issue
In a controller action:
Expected results
I should be able to specify a statusCode of choosing
Actual results
The browser receives a 302 response code always.
Thanks for all your support!