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.

1 Answer 1

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

That should do the trick.

Sign up to request clarification or add additional context in comments.

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.