Routing Problem |
[eluser]Vasi[/eluser]
Hi guys, I used for routing the method from here: http://ellislab.com/forums/viewthread/146402/#717286 I have no problem when routing like this: Code: $route['example_controller/(:any)'] = 'example_controller/$1'; but when I try to add a method like bellow it doesn't work: Code: $route['example_controller/method/(:any)'] = 'example_controller/method/$1'; Any help would be appreciate it. Thanks.
[eluser]mddd[/eluser]
You must remember that (:any) can match more than one segment. So the route Code: $route['controller/(:any)'] = 'controller/$1'; Code: controller/some_method/some_value The solution is to always put the most specific rule first. If it is not matched, a more general rule might still match.
[eluser]LuckyFella73[/eluser]
In a project I use this code and it works fine: Code: $route['controller/method/(.*)'] = "de/controller/method/$1"; Hope that helps
[eluser]Vasi[/eluser]
Thanks guys, I changed the order of the rules and it worked. Thanks again.
[eluser]Reneesh T K[/eluser]
Hi, I was also a problem with codeigniter url rewriting. I have to go to www.abc.com/catalog/product/4354 when using the url www.abc.com/samsung_galaxy_y I have resolved it using the following from myphplibrary.blogspot.com and it worked fine for me. Check it out. http://myphplibrary.blogspot.in/2012/03/...n-url.html |
Welcome Guest, Not a member yet? Register Sign In |