Iis Url重写:重定向传递查询参数
使用IIS 7.5,如何重定向Iis Url重写:重定向传递查询参数,iis,url-rewriting,iis-7.5,Iis,Url Rewriting,Iis 7.5,使用IIS 7.5,如何重定向 http://localhost/en/test?id=tool-37 到 我写了这个规则,但它不起作用 <rule name="Tool-Diseases" stopProcessing="true"> <match url="(.+)/test.+id=([0-9]+)" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
http://localhost/en/test?id=tool-37
到
我写了这个规则,但它不起作用
<rule name="Tool-Diseases" stopProcessing="true">
<match url="(.+)/test.+id=([0-9]+)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="{R:1}/tool/{R:2}" appendQueryString="true" />
</rule>
谢谢URL和查询字符串在IIS重写模块中分别处理 例如,如果请求此URL:,并且在站点级别定义了重写规则,则:
- 规则模式获取URL字符串content/default.aspx作为输入
- QUERY_STRING服务器变量包含tabid=2和subtabid=3李>
- HTTP_主机服务器变量包含www.mysite.com李>
- 服务器端口服务器变量包含80李>
- SERVER\u PORT\u SECURE SERVER变量包含0,HTTPS包含OFF李>
- 请求URI服务器变量包含/default.aspx?tabid=2&subtabid=3
<rule name="Tool-Diseases" stopProcessing="true">
<match url="(.+)/test.+id=([0-9]+)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="{R:1}/tool/{R:2}" appendQueryString="true" />
</rule>