I am using Zend FW 1.9.2, I want to disable the default routes and provide my own. I really don't like the default route /: controller /: action.
The idea is to enter routes in init, and when the request cannot be redirected to one of the entered routes, it should be redirected to the error controller. (using the default case of Zend_Controller_Plugin_ErrorHandler)
Everything works fine until I turn off the default routes using $ router-> removeDefaultRoutes (); When I do this, the error controller no longer sends unsolicited requests to the error controller. Instead, it redirects all unsolicited indexAction requests to the default controller.
Can anyone think of how to disable the default routing /: controller /: action, but DON'T GET route error handling?
Basically, this is what I am doing:
$frontController = Zend_Controller_Front::getInstance(); $router = $frontController->getRouter(); $router->removeDefaultRoutes(); // <-- when commented, errorhandling works as expected $route = new Zend_Controller_Router_Route_Static( '', array('controller' => 'content', 'action' => 'home') ); $router->addRoute('home', $route);
source share