Search code examples
zend-frameworkhttp-redirecthttp-status-code-301

Why does Zend Framework's $this->_redirect($url, array('code'=>301)) result in a 302 code?


When I call:

$this->_redirect($url, array('code'=>301));

I get redirected, but the http code is 302 instead of 301. Any idea why?


Solution

  • It appears that using the _redirect method will always set the code to a 302. If you'd like to manually change the response code, use a redirector instead.