I have IndexController. I need to set raw header in indexAction.
I try to make
function indexAction(){
$this->getResponse()->setRawHeader('HTTP/1.1 404 Not Found');
}
But I see in Google chrome status 200 OK.
How set raw header?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To set a 404, use:
If you don’t explicitly set an HTTP response code, ZF will automatically send a 200 response if it was not overridden by
setHttpResponseCode. Once it sends all the headers it checks to see if a response code was sent, and if not, sends a 200 regardless of your rawHeader.