[eluser]Unknown[/eluser]
I'm not sure if this is the correct place to post this, so please let me know.
I want each module to contain it's own routes file, with routes that simplify the module's actual URL.
For example, I have a products module and it contains 2 controllers: cart and catalog.
I can hit the pages for these by going to products/cart/ and products/catalog,
but I'd like to be able to route cart/ to products/cart and catalog/ to products/catalog,
which doesn't work.
Here is the code in application/modules/products/config/routes.php:
Code:
$route['products'] = 'store';
$route['catalog/(:num)/(:num)'] = "catalog/view_product/$1/$2";
$route['catalog/(:num)'] = "catalog/view_product/$1";
$route['catalog/results'] = "catalog/results";
$route['catalog/all'] = "catalog/view_all";
$route['cart'] = "cart/index";
$route['cart/(:any)'] = "cart/$1";
Any advice would be appreciated!