Jakub Podhorský wrote:
I want to check if this controller exist and if it doesnt I want to redirect
it on some NotFoundController or any default or by myself defined
controller.
I do this using the preDispatch hook of a front controller plugin.
public function preDispatch(Zend_Controller_Request_Abstract $request) {
$disp = Zend_Controller_Front::getInstance()->getDispatcher();
if ( !$disp->isDispatchable($request) ) {
$request->setModuleName('default');
$request->setControllerName('error');
$request->setActionName('error404');
}
}
if the thing doesn't exist ( /registerxxx instead of /register for
example ) then they get bounced to a 404 page. It has worked so far for me.