I'm using a site wide parameter that controls the layout of the website. This parameter goes before anything else in the URL and is followed by the usual controller/parameters sections.
mywebsite/{section}/controller/parameter1/parameter2
I could define routes like the one bellow for each controller, but would like to avoid it as the section parameter is only relevant to the layout and not to the controllers.
$route['(:any)/controller/(:any)/(:any)'] = 'controller/$2/$3/$1';
Instead I would to be able to make the default_controller catch the first segment and store it as a view variable or session / cookie, so that the rest of the controllers can simply ignore it.
$route['(:any)/controller/(:any)/(:any)'] = 'controller/$2/$3';