asp.net - IIS 重写 - 匹配 URL 覆盖
问题描述
我正在尝试设置一些 301 重定向,但是我遇到了匹配 URL 语句的问题。
这是我的 IISUrlRewrite.xml 文件:
<rewrite>
<rules>
<rule name="CAS to PAS" stopProcessing="true">
<match url="/call-answering-service" />
<action type="Redirect" url="/us/phone-answering-service" redirectType="Permanent" appendQueryString="true" />
</rule>
<rule name="PAS tp CAS lp" stopProcessing="true">
<match url="/us/lp/phone-answering-service" />
<action type="Redirect" url="/us/lp/call-answering-service" redirectType="Permanent" appendQueryString="true" />
</rule>
</rules>
</rewrite>
所以第一个重定向https://localhost:5001/us/call-answering-service/
应该重定向到https://localhost:5001/us/call-answering-service/
这个工作正常,但是,第二个重定向生活在
https://localhost:5001/us/lp/phone-answering-service/
重定向到https://localhost:5001/us/phone-answering-service
而不是https://localhost:5001/us/lp/call-answering-service/
我假设这导致它与 URL 匹配的第一条规则包含 /call-answering-service 在它被第二条规则重定向并命中第一条规则之后。有没有办法让我更明确?
谢谢
解决方案
推荐阅读
- algorithm - 减少闭合轮廓中点数的已知算法
- python - 有没有办法在单个数据点内有多个绘图以与分类器一起使用?
- graphql - GraphQL 突变问题
- scala - 如何在 Scala 中区分 SortedMap 和 TreeMap?
- asp.net-core-mvc - 有条件地处理 ASP.NET Core 中的拒绝访问行为
- javascript - 如何始终在单击的元素下方打开 contextMenu?
- javascript - 无法在谷歌表单中设置依赖下拉
- ios - Xamarin iOS 在 UIButton 中显示图像和文本
- c# - 为什么在运行时调用重载函数时会发生 RuntimeBinderException?
- android - Android 应用程序 Api 1 与 Api 2 中的 Google Pay