【问题标题】:iis 7 relative redirect with get parameters带有获取参数的 iis 7 相对重定向
【发布时间】:2011-04-02 12:06:18
【问题描述】:

我在 iis7 中有一个 http 重定向,可以将请求发送到另一个域。如果 url 类似于 http://www.example.com/news/ 没关系,但如果我尝试 http://www.example.com/news/?id=3 然后从字符串中删除获取参数,它会重定向到相同的 http://www.example.com/news/。 iis7如何在查询字符串中保存get参数?

web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <httpRedirect enabled="true" destination="http://www.example.com" exactDestination="false" httpResponseStatus="Permanent" />
    </system.webServer>
</configuration>

【问题讨论】:

    标签: iis-7 http-redirect


    【解决方案1】:

    我相信您只需将“$S$Q”添加到重定向 URL 的末尾,例如目的地=“http://www.example.com$S$Q”。

    另请参阅相关的 StackOverflow 问题:How to redirect a URL path in IIS?

    【讨论】:

    • 您也必须检查“将所有请求重定向到确切的目的地(而不是相对于目的地)”。否则,URL 的路径部分会附加两次。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-03-31
    • 2011-06-24
    • 1970-01-01
    • 2014-01-25
    • 2011-05-30
    • 2012-12-21
    • 2010-10-24
    相关资源
    最近更新 更多