使页面标题成为 url 的最简单方法是什么?
目前我有:
http://localhost:53379/Home/Where
http://localhost:53379/Home/About
http://localhost:53379/Home/What
并想拥有
http://localhost:53379/where-to-buy
http://localhost:53379/about-us
http://localhost:53379/what-are-we
我考虑route
在每个页面上添加一个(只有 9 页),但我想知道是否有更好的东西,例如对于大型网站。
routes.MapRoute(
name: "Default",
url: "where-to-buy",
defaults: new {
controller = "Home",
action = "Where",
id = UrlParameter.Optional
}
);
...
我也想用英语和当地语言,所以添加更多路线没有多大意义......