[eluser]Phil Sturgeon[/eluser]
I flip mine around:
Code:
$route['admin/([a-zA-Z_-]+)/(:any)'] = "$1/admin/$2";
$route['admin/([a-zA-Z_-]+)/(:any)/(:any)'] = "$1/admin/$2/$3";
$route['admin/login'] = "admin/login";
$route['admin/logout'] = "admin/logout";
$route['admin/([a-zA-Z_-]+)'] = "$1/admin/index";
$route['admin'] = "admin";
That can be tidied down im sure, it's just something that I set up and seems to work fine for me. Each of my modules has its own rules on how to handle many of the common URL's but this basically means that:
Quote:admin/blog/create
is routed to:
Quote:blog/admin/create
which is mapped to:
Quote:Module: blog
Controller: Admin
Method: create
Then underneath those you can put in your rule:
Code:
$route['(.*)/blog'] = 'site/blog';