我在路由配置文件中配置了此路由。
routes.MapRoute(
"CMS",
"CMS/{id}/{title}",
new { controller = "CMS", action = "Index" },
namespaces: new[] { "abc.def.Web.Controllers" }
);
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional },
namespaces: new[] { "abc.def.Web.Controllers" }
);
问题是它会正确显示第一个请求i-e example.com/cms/86b537d5-84a9-43a2-8736-0ff08aa44ae4/contentone
但是当我点击cms的第二个链接时,它会给出如下错误。
生成的网址为example.com/cms/cms/86b537d5-84a9-43a2-8736-0ff08aa44ae4/contenttwo
错误是:404。任何人都可以指导我。