I think, all answers above are incorrect. Those show ways to achieve the same thing, but present logic at the wrong place in your application, which eventually can cause trouble later on.
The correct part of your route logic is, how extremely simple, in the routes. What is missing is that the default route Zend_Controller_Router_Route_Module
does not allow you to add exceptions to specific routes. So what you need to do, is remove the default route from your routes, and add a new custom route (which should function exactly as the default route, but allows excludes) at it's place.
You can write the new route by extending the class of the default route.
class My_Custom_Route extends Zend_Controller_Router_Route_Module
{
protected $_excludes = array();
public function exclude($abc)
{
//add to $_excludes here the controller/action you want to exclude
}
public function match($abc)
{
//add functionality here that denies if the mod/contr/action is in $_excludes
//you can also add this in a separate method
//re-use parent code
}
}
You can now add add the excludes for example in a config file, and load + add the excludes at the place you initiate the new Route (and add it to the router). Off you go.