My website uses categories and sub-categories.
I'd like the follow mapping:
/Category/Fruit
/Category/Fruit/Apples
But if I use the below:
routes.MapRoute(
"Category", // Route name
"Category/{category}/{subcategory}", // URL with parameters
new { controller = "Entity", action = "Category" } // Parameter defaults
);
I get a 404 for /Category/Fruit however /Category/Fruit/Apples works ok. I'd like /Category/Fruit to work as well but I can't add another route with the same name. How do I get around this?
Thanks in advance.