Шаблоны маршрутов должны быть уникальными, чтобы избежать конфликтов маршрутов
//url/details/honda-civic-20-review
routes.MapRoute(
name: "postdetail",
url: "details/{SeoFriendlyUrl}",
defaults: new { controller = "PostDetail", action = "Index", SeoFriendlyUrl = UrlParameter.Optional },
namespaces: new[] { "RiviWeb.Controllers" }
);
//url/categories/luxury
//url/categories/normal
//url/categories/sedan
routes.MapRoute(
name: "postcategory",
url: "categories/{SeoFriendlyUrl}",
defaults: new { controller = "PostCategory", action = "Index",SeoFriendlyUrl = UrlParameter.Optional },
namespaces: new[] { "RiviWeb.Controllers" }
);
//url/brands/toyota
//url/brands/hyndai
//url/brands/lexus
routes.MapRoute(
name: "brand",
url: "brands/{SeoFriendlyUrl}",
defaults: new { controller = "Brands", action = "Index",SeoFriendlyUrl = UrlParameter.Optional },
namespaces: new[] { "RiviWeb.Controllers" }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}",
defaults: new { controller = "Home", action = "Index"},
namespaces: new[] { "RiviWeb.Controllers" }
);