Zend_Controller_Router_Exception: Route default is not defined
Apparently when you create custom routes, Zend Framework "forgets" about the default route, causing this error to appear.
To quickly resolve this issue, you just open up application/Bootstrap.php and add the following to your routines:
protected function _initDefaultRoutes()
{
$frontController = Zend_Controller_Front::getInstance();
$frontController->getRouter()->addDefaultRoutes();
}
If you already have routine for loading routes, just ensure you add the default routes!
protected function _initRouteSetup()
{
$frontController = Zend_Controller_Front::getInstance();
$router = $frontController->getRouter();
$config = new Zend_Config_Ini('/path/to/config.ini', APPLICATION_ENV);
$router->addConfig($config, 'routes');
// ensure you load the default routes as well!!!
$router->addDefaultRoutes();
}
With this blog article I hope to save a bunch of people a lot of time looking for an example and get on with building awesome applications.






