[eluser]lamhuy300890[/eluser]
Hi,
My site have many categories: shoes, clothing ... and sub categories:
clothing
|--- T-shirt
|--- Shirt
....
I want to route my URL like:
mysite/clothing : show all products in clothing category.
mysite/clothing/shirt : show products in shirt sub category.
mysite/clothing/shirt/product1 : show detail for product1.
My routes file like this:
$route['Products/(:any)'] = 'product/category/$1';
$route['Products/(:any)/(:any)'] = 'product/subcategory/$2';
The first route for category is ok, but the second route for sub category doesn't work.
How can i solve it?
Thanks