I've spent many hours trying to get this to work. And I'm getting quite desperate. Would be great if someone out there could help me out :)
Currently using Zend Framework 1.9.5, though I have been struggling to get this to work for many versions now.
What I want to do is provide my own routes through an XML config, and make sure that everything that is not defined in my config will end up on my errorController.
(preferably in a way so I can em apart from EXCEPTION_NO_CONTROLLER
and EXCEPTION_NO_ACTION
)
I figured that this means I have to get rid of default /:module/:controller/:action and /:controller/:action routes.
So when I tell the router to removeDefaultRoutes(), it won't match these default routes anymore. But now the router is now routing every unrouted route to the defaultcontroller::defaultaction (What the ??)
$front->getRouter()->removeDefaultRoutes();
So, anyone know how to make the frontcontroller (or a part of it) throw an exception when an URI can not be routed?
Reason I want to do this is to prevent duplicate content, and have better 404 pages (in this case, no controller / no action errors are actually application errors instead of not-found)