Welcome Guest, Not a member yet? Register   Sign In
Custom routing, if not controller, do following
#1

[eluser]msteudel[/eluser]
I was wondering if there is a way to do something with routing so that if the string where the controller is isn't a controller it does one thing and if it is a controller then it performs normally. I'm pursuing a regex route, but I didn't want to have to hard code all of my controllers in it ...
#2

[eluser]gyo[/eluser]
There is a new route in CodeIgniter 2: $route['404_override'] = 'controller/method';

Where 'controller/method' is the one that will be called in case the requested controller doesn't exist.

Hope it helps!
#3

[eluser]msteudel[/eluser]
Interesting, I'm still on 1.7.2 but that's cool to know about. I ended up doing something like this:

$route['^(?!discover|blog|support|photos).*'] = "photos/show/$0";




Theme © iAndrew 2016 - Forum software by © MyBB