我已经在.net core 2.1上进行了项目设计,在其中我重写了类似的网址
var rewrites = new RewriteOptions()
.AddRewrite(@"GetCountryInfo", "Home/GetCountryInfo", skipRemainingRules: true)
.AddRewrite(@"about-us", "Home/About", skipRemainingRules: true)
.AddRewrite(@"pricing", "Home/Pricing", skipRemainingRules: true)
.AddRewrite(@"sign-in", "Home/Sign_in", skipRemainingRules: true)
.AddRewrite(@"sign-up", "Home/Sign_up", skipRemainingRules: true)
它工作正常,但是当使用此网址添加内容时,它的工作原理也是不可接受的。
像
localhost:5000/about-us/abc
localhost:5000/about-us1
我想从网址中忽略此/ abc或1。我该如何实现?