CodeIgniter Forums
route all uri to one special uri except some cases - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: route all uri to one special uri except some cases (/showthread.php?tid=1056)



route all uri to one special uri except some cases - bluebox - 02-08-2015

I want all uri of my site route to one controller. Except The uri starting with home, admin, login or sigun_up will not route to that one controller. How would you do that?

I'm thinking some kind of reg ex, something like this

$route["all link route to this bosss controller, except uri starting with admin, login, home and sign_up"] = 'boss controller';


RE: route all uri to one special uri except some cases - Rufnex - 02-09-2015

What about
PHP Code:
$route['^(admin|login|home|sign_up)'] = 'other_controller'
$route['(:any)'] = 'both_controller'



RE: route all uri to one special uri except some cases - bluebox - 02-10-2015

that's exactly what i'm looking for. Thanks