Reputation: 121
I got stack on this in Codeigniter route, What do I want is to remove the function_name in url to be able to have a short url.
Here is the example want to have in my url
to this
Is there any other solution to have this if cannot be done in route? thanks!
Upvotes: 0
Views: 1348
Reputation: 378
If the above didn't work you could try:
$route['controller_name/(:num)'] = 'controller_name/lookup_function/$1';
Not much different from what was already suggested other than a hard coded controller name.
Upvotes: 1
Reputation: 11064
You can probably do it by trying:
$route['([a-z]+)/(\d+)'] = "$1/method/$2";
That is if you don't need to change the name of your method.
Upvotes: 0