我最初在我的 RouteConfig 中有这个 maproute
routes.MapRoute(
name: "thread",
url: "{Areamix}/{urltitle}/{id}/thread",
defaults: new {controller = "thread", action = "view"
});
这条路线太长了,所以我把它缩短到
routes.MapRoute(
name: "thread",
url: "{urltitle}/{Areamix}-{id}",
defaults: new
{
controller = "thread",
action = "view"
});
正如您已经知道,由于路由 URL 已更改,旧网页现在返回 404 错误,我怎样才能将旧索引页面重定向或永久重定向到较新的 MapRoute ?他们都有共同的特征,比如{id}任何建议都会非常感谢。