【发布时间】:2011-08-25 01:18:59
【问题描述】:
在 IIS7 URL 重写模块中,我可以在重定向规则中指定不适用于 http-post 请求吗?我正在使用 Microsoft 提供的模板来小写所有 url 并附加一个斜杠。但是,我有一个不符合此规范的 AJAX 发布请求,但它们破坏了我们将它们重写为 301。我不担心 SEO 的 POST 请求,所以我更愿意在规则中指定忽略它。以下是我的规则:
<rule name="AddTrailingSlashRule" stopProcessing="true">
<match url="(.*[^/])$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Redirect" url="{R:1}/" />
</rule>
<rule name="LowerCaseRule" stopProcessing="true">
<match url="[A-Z]" ignoreCase="false" />
<action type="Redirect" url="{ToLower:{URL}}" />
</rule>
【问题讨论】:
标签: iis-7 url-rewriting http-post