I would like to send any route that does not match the admin route to my event controller. This seems like a fairly common requirement, and a quick search throws all kinds of similar questions .
The solution, as I understand it, seems to use a negative expression in the regular expression. So my attempt looks like this:
$route['(?!admin).*'] = "event";
.. which is working. Well, sort of. It sends any non-admin request to my event controller, but I need to pass the actual string that was matched: therefore / my-new-event / is redirected to / event / my new event /
I tried:
$route['(?!admin).*'] = "event/$0"; $route['(?!admin).*'] = "event/$1"; $route['(?!admin)(.*)'] = "event/$0"; $route['(?!admin)(.*)'] = "event/$1";
... and several other increasingly random and desperate permutations. All results on page 404.
What is the correct syntax for passing a matched string to a controller?
Thanks:)
source share