IIS重定向无法正常工作3

时间:2014-12-11 19:55:42

标签: iis url-redirection url-rewrite-module

有人可以解释为什么这条规则不起作用?当下面的查询字符串在url

中时,我想要永久重定向
<rule name="Telephony Document Lib Redirect" stopProcessing="true">
    <match url="(.*)?RootFolder=%2FTechnology%2FShared%20Documents%2FTelephony(.*)" />
    <action type="Redirect" url="https://{HTTP_HOST}/sites/teams/Telephony" appendQueryString="false" redirectType="Permanent" />
</rule>

1 个答案:

答案 0 :(得分:0)

查询字符串与url是分开的,应该使用条件进行匹配,如下所示:

<rule name="Telephony Document Lib Redirect" stopProcessing="true">
    <match url="(.*)" />
    <conditions>
        <add input="{QUERY_STRING}" pattern="RootFolder=%2FTechnology%2FShared%20Documents%2FTelephony(.*)" />
    </conditions>
    <action type="Redirect" url="https://{HTTP_HOST}/sites/teams/Telephony" appendQueryString="false" redirectType="Permanent" />
</rule>