【问题标题】:IIS Redirect not working 3IIS 重定向不起作用 3
【发布时间】:2014-12-11 19:55:41
【问题描述】:

谁能解释为什么这条规则不起作用?当下面的查询字符串在 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>

【问题讨论】:

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


    【解决方案1】:

    查询字符串与 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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-27
      • 2015-01-29
      • 1970-01-01
      • 2013-01-26
      • 1970-01-01
      • 2021-10-31
      • 1970-01-01
      • 2018-02-19
      相关资源
      最近更新 更多