I'm using Zend FW 1.9.2, want to disable the default routes and supply my own. I really dislike the default /:controller/:action routing.
The idea is to inject routes at init, and when the request cannot be routed to one of the injected routes it should be forwarded to the error controller. (by using the defaultly registere Zend_Controller_Plugin_ErrorHandler)
This all works fine, until I disable the default routes with $router->removeDefaultRoutes(); When I do that, the error controller no longer routes unrouted requests to the error controller. In stead, it routes all unrouted requests to indexAction on the default controller.
Anyone have any idea how to disable the default /:controller/:action routing but KEEP the route error handling?
Basically, this is what I do:
$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);