I am trying to setup routing based on the 1st URI segment.
I have a rule:
$route['(:any)'] = pages/view_page/$1;
I want to make my routes conditional so that if a controller of the name of URI segment 1 is called it goes to the controller as normal. If no controller exists then go to the pages/view_page function.
I have tried wrapping the $route rule with an if statement that checks URI segment 1 and uses that to see if a file exists to match it but this doesn't seem to work.
Does anybody have any suggestions for how to do this without having to write lots of route configurations.