[eluser]wilso417[/eluser]
[quote author="wiredesignz" date="1288837291"]The module name is not needed in the route value. It is assumed.
Code:
$route['news(.*)'] = 'views$1';
//or
$route['news'] = 'views';
$route['news/(.*)'] = 'views/$1';
This segments will be a controller/method or sub-directory/controller/method etc[/quote]
I tried that with this:
app/config/routes.php:
$route[‘admin/([a-zA-Z_-]+)/(:any)’] = “$1/admin/$2”;
modules/news/config/routes.php:
$route[‘news/:any’] = “views/$1”;
still does not work with a url of admin/news/function. It redirects to news module only, and then modules/news/config/routes.php tries to redirect and goes to 404. If I do:
app/config/routes.php:
$route['admin/([a-zA-Z_-]+)/(:any)'] = "$1/admin/$2";
$route['news/(:any)'] = "news/view/$1";
That will work. That is how i'd expect putting routes in my module folder, that it'd be a lower precedence but that is not the case. What is the point of putting routes inside a module then?