Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zend > configuration for catching unmatched regex routes

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

like image 756
shasi kanth Avatar asked Nov 27 '25 03:11

shasi kanth


1 Answers

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.

like image 113
Robin Avatar answered Nov 29 '25 15:11

Robin