Help with route regex if specific words are present

I have a few custom pages like

Currently they are going to their own controllers. I want to create a generic controller that will handle these specific pages but leave the rest of the routing alone.

I think this is close but can't quite get it. I'm a regex idiot...and I admit it.
$route['((?about|help|home|privacy|tou).*)'] = 'custom_page/$1';

Thanks for any help.

[eluser]Cristian Gilè[/eluser]
You could put a _remap() in your base controller.

Cristian Gilè

Thanks. I'm not using a single base controller. If the url is a certain word, I want to map it to a specific controller and leave the rest alone.

Basically a one liner for:
$route['about'] = 'custom_page/about';
$route['home'] = 'custom_page/home';
$route['help'] = 'custom_page/help';

$route['(.*)/communities/(.*)'] = 'locations/view_community/$1/$2';
more routes...

[eluser]Imran Tariq[/eluser]
Instead of using this
[quote author="CroNiX" date="1294967168"]
$route['about'] = 'custom_page/about';
$route['home'] = 'custom_page/home';
$route['help'] = 'custom_page/help';[/quote]
You should try this
Quote:$route['about|home|help'] = 'custom_page/$1';

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.