1
votes

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.

1

1 Answers

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

That should do the trick.