tags:

views:

16

answers:

1

My controllers are at controllers/frontend directory I access them trough http://localhost/controller_name.

In a routes.php i have that record $route['([a-z_]+)'] = "frontend/$1" and everything works.

But how to change route rule if I want to access http://localhost/controller_name/method/param;

+1  A: 

Your rule is sending everything to /frontend/$1 which is a silly idea.

If you have to do that, do this:

$route['(some_controller|other_controller)'] = '$1';
$route['(some_controller|other_controller)/(:any)'] = '$1/$2';

By doing it this way you are essentially destroying CodeIginter automatic routing, as you send EVERYTHING BUT certain controllers to the frontend. To learn how to build a Admin backend properly, try this article:

http://philsturgeon.co.uk/news/2009/07/Create-an-Admin-panel-with-CodeIgniter

Phil Sturgeon