How to throw 404 exceptions in Zend Framework
You can do like this:
$this->getResponse()->setHttpResponseCode(404);
or
throw new Zend_Controller_Action_Exception('This page does not exist', 404);
You can do it like this:
$this->getResponse()->setHttpResponseCode(404);
return;