You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

IIS重定向规则配置求助:Webinar地址Product1转至Product2

IIS URL重定向规则修正方案

你的重定向规则未生效主要存在两个问题,以下是修正后的配置及说明:

<rewrite>
    <rules>
        <rule name="v2-r1" stopProcessing="true">
            <match url="^webinars/Product1" />
            <action type="Redirect" url="/webinars/Product2" appendQueryString="true" />
        </rule>

        <rule name="Hide-Controller" stopProcessing="true">
            <match url="^(.*)$" ignoreCase="false" />
            <conditions logicalGrouping="MatchAll">
                <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php" appendQueryString="true" />
        </rule>
    </rules>
</rewrite>

修改点说明:

  • 移除match url开头的斜杠:IIS Rewrite模块的match url属性匹配的是请求路径中去掉站点根目录后的部分,无需开头的/,原规则里的^/webinars/Product1无法匹配到正确路径。
  • 给重定向规则添加stopProcessing="true":当这条重定向规则匹配成功后,直接停止后续规则执行,避免不必要的处理,同时确保重定向动作优先完成。
  • 第二条Hide-Controller规则配置无问题,会在请求非静态文件时将路径重写到index.php,保留原有逻辑即可。

内容的提问来源于stack exchange,提问作者Essex Steph

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.25 09:33:04