Sco*_*son 3 asp.net iis ajax url-rewriting
我将如何创建强制小写 URL 的 URL 重写规则,除非请求是 AJAX 请求,即标头 X-Requested-With 具有 XMLHttpRequest 的值?
弄清楚了。
<rule name="LowerCaseURL" stopProcessing="true">
<match url="[A-Z]" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_X_Requested_With}" pattern="^XMLHttpRequest$" negate="true" />
</conditions>
<action type="Redirect" url="{ToLower:{URL}}" />
</rule>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2059 次 |
| 最近记录: |