【问题标题】:IIS URL 301 rewrite / redirect not workingIIS URL 301 重写/重定向不起作用
【发布时间】:2020-08-25 17:46:26
【问题描述】:

我正在尝试使用 IIS URL 重写模块进行 301 重定向。 我用谷歌搜索,查看了视频并设置了不同的设置,但它什么也没做......意思是,我设置重定向的链接仍然像以前一样工作。我什至没有收到错误。

这是我的设置:

我还尝试使用与我尝试重定向的链接在同一域中的重定向 URL...再次,没有任何反应,链接仍然像以前一样工作,也没有错误。

非常感谢任何帮助。

【问题讨论】:

    标签: url redirect iis url-rewriting


    【解决方案1】:

    匹配 URL 中不包含查询字符串?在正则表达式中具有不同的含义。

    请使用 {REUEST_URI} 和 \?而是。

    <rule name="rewrite rule" enabled="true" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{REQUEST_URI}" pattern="/Turf/ProductView.cfm\?P=151" />
                    </conditions>
                    <action type="Redirect" url="https://www.weathermatic.com/products/6000-pro-rotors/{R:0}" />
    

    它会将 Turf/ProductView.cfm?P=15 重定向到 https://www.weathermatic.com/products/6000-pro-rotors/Turf/ProductView.cfm?P=151

    【讨论】:

    • 工作就像一个魅力。非常感谢。
    • @DanRollans。要求您接受答案。所以回复可以帮助更多的人。
    猜你喜欢
    • 1970-01-01
    • 2015-01-29
    • 2011-10-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-27
    • 2015-03-23
    • 1970-01-01
    相关资源
    最近更新 更多