【问题标题】:IIS 7 URL rewriting from http to httpsIIS 7 URL 从 http 重写为 https
【发布时间】:2012-07-23 08:53:55
【问题描述】:

我的 web.config 文件中有这个:

<system.webServer>
    <rewrite>
        <rules>
            <rule name="HTTP to HTTPS redirect" stopProcessing="true">
                <match url="(.*)" />
                <conditions>
                    <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                </conditions>
                <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>

我检查了该规则是否已添加到 IIS 管理器中,但它似乎不起作用。我已经关闭了要求 SSL。

因此,如果我访问 webvts.mprin.com 或 http://webvts.mprinc.com,我会收到 404 not found 错误。但如果我去https://webvts.mprinc.com,一切正常。

【问题讨论】:

    标签: iis redirect iis-7 web-config rewrite


    【解决方案1】:

    我的 SharePoint Web 应用程序遇到了这个问题。这是一个带有外联网扩展的内联网。 Extranet 只设置了 443。一旦我在 IIS 中的 Extranet 应用程序上为端口 80 添加了绑定,重定向就成功了。

    【讨论】:

      猜你喜欢
      • 2012-02-28
      • 2016-03-20
      • 1970-01-01
      • 2015-07-27
      • 1970-01-01
      • 2014-07-18
      • 2013-07-01
      • 2012-12-26
      相关资源
      最近更新 更多