How should be a zend router rule for a catch-all cases?
-
25-09-2019 - |
Question
I'm trying to make a simple route which catches this:
/static_stuff.php?blablabla&moreblabla=blablabl&evenmorebla=moreblablabl
I need to use a config (ini) file for it: we're using routes like this:
resources.router.routes.redirect404b.route = "/thumbs"
resources.router.routes.redirect404b.defaults.controller = "photoset"
resources.router.routes.redirect404b.defaults.action = "showall"
resources.router.routes.redirect404b.defaults.message = "Page removed"
In fact, I'm making a route to redirect old traffic to the new controllers (bots, bookmarks, etc). But I don't know how to do it. Any ideas? I think I have to use regex, but I don't even know how to include it in the ini file, nor which would be the regex. BTW, among others, I tried this:
resources.router.routes.redirect404b.route = "/static_stuff.php*"
But that is not being triggered. Seems that adding *
at the end makes nothing. What else do I need for this?
Solution
Add
resources.router.routes.redirect404b.type="Zend_Controller_Router_Route_Regex"
as the first line to make it a regex route since you are using a * in your route.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow