routes.MapLocalizedRoute("otc", "otc/{dir}/{id}.html", new { controller = "Category", action = "CategoryList" }, new[] { "Hu.Web.Controllers" }); routes.MapLocalizedRoute("qixie", "qixie/{dir}/{id}.html", new { controller = "Category", action = "CategoryList" }, new[] { "Hu.Web.Controllers" }); routes.MapLocalizedRoute("bjp", "bjp/{dir}/{id}.html", new { controller = "Category", action = "CategoryList" }, new[] { "Hu.Web.Controllers" }); routes.MapLocalizedRoute("cf", "cf/{dir}/{id}.html", new { controller = "Category", action = "CategoryList" }, new[] { "Hu.Web.Controllers" });
上边的路由能匹配前3个,最后一个怎么换位置访问都是404,
这4个路由如果换成一个
routes.MapLocalizedRoute("Categories", "{category}/{dir}/{id}.html", new { controller = "Category", action = "CategoryList" }, new[] { "Hu.Web.Controllers" });
全部路径都是404,不太清楚为什么!
如果再有分页条件什么的我得再写几个一样的路由
routes.MapLocalizedRoute("cfPage", "cf/{dir}/{id}-{page}.html", new { controller = "Category", action = "CategoryList" }, new[] { "Hu.Web.Controllers" });
有没有好的解决方案?
routes.MapLocalizedRoute("Categories", "{category}/{dir}/{id}.html", new { controller = "Category", action = "CategoryList" }, new[] { "Hu.Web.Controllers" });这种可以用了,是自己重写Route的时候写错路径了