【问题标题】:Simple 301 Redirect in Web.Config (IIS)Web.Config (IIS) 中的简单 301 重定向
【发布时间】:2017-05-31 18:19:11
【问题描述】:

我在这里浏览了很多类似的问题,但大多数都有与之相关的复杂参数。我只是希望 301 将一个链接重定向到同一域上的另一个链接。 to 和 from 链接非常具体,所以我不需要考虑任何通配符。

在 web.config 中,将 /locations/100-denver 301 重定向到 /locations/denver 的合适方法是什么?

【问题讨论】:

    标签: redirect iis web-config http-status-code-301


    【解决方案1】:
    <configuration>
        <system.webServer>
            <rewrite>
                <rewriteMaps>
                    <rewriteMap name="Redirects">
                        <add key="/test.aspx" value="/test2.aspx" />
                        <add key="/aboutus.aspx" value="/about" />
                    </rewriteMap>
                </rewriteMaps>
            </rewrite>
        </system.webServer>
    </configuration>
    

    我只是在研究一个类似的主题,并在另一个页面上找到了这个答案:enter link description here

    【讨论】:

    • 这个不行,因为它只是一个重写图,没有任何规则
    猜你喜欢
    • 2013-02-06
    • 2013-01-01
    • 1970-01-01
    • 2016-01-27
    • 2010-12-09
    • 2012-02-20
    • 2012-04-23
    • 2019-04-16
    • 2015-03-05
    相关资源
    最近更新 更多