Ble*_*ger 15 iis-7 url-rewriting http-post
在IIS7 URL Rewrite模块中,我可以在重定向规则中指定不适用于http-post请求吗?我使用Microsoft提供的模板来小写所有URL并附加一个尾部斜杠.但是我有一个AJAX帖子请求不符合这个规范,但他们打破我们他们被重写为301s.我并不担心对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>
Run Code Online (Sandbox Code Playgroud)
pat*_*dge 30
您可以{REQUEST_METHOD}在条件下访问变量中的内容.
<add input="{REQUEST_METHOD}" matchType="Pattern" pattern="POST" ignoreCase="true" negate="true" />
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7342 次 |
| 最近记录: |