views:

32

answers:

1

So basically what I want to do is have my routes.php setup so that if the route is defined then it uses that routing rule else it does something like this:

domain.com/VAR/controller/method/(vars) to domain.com/controller/method/var/(vars)

I think it can be done with a regex, but my regex-fu is very weak. Any tips would be greatly appreciated.

A: 
$route['domain.com/(:any)/controller/method/(:any)'] = 'domain.com/controller/method/$1/$2';

That should do the trick.

Yorick Peterse
This works, but wish i didn't have to write a route for every metho/controller and could map it for ALL routes except ones that are predefined
Ian Livingstone