i am using zend framework for my application and i have used few regex routes for routing the users to specific controllers and actions based on the options in url.
But when a url pattern is not matched, i get a 404 error like: Page Not Found.
How can i specify configuration, such that when the regex route does not match the specified urls, the control routes to a default controller and action?
FYI, i would like to route to the "index" controller and "index" action by default
You could create your own "catch all" Route and place this in to the Router so that it runs after the regex one. IIRC, the Router component loops the installed Routes (backwards?) and the first one that returns true triggers the process to exit. Your "catch all" Route would always return true.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With