【问题标题】:URL Rewrite from https to http for one page一页的 URL 从 https 重写为 http
【发布时间】:2014-12-09 08:28:03
【问题描述】:

我需要为单个页面执行 URL 重定向。如果客户访问https://example.com/default.aspx 我需要发送到http://example.com/default.aspx 并且到目前为止收效甚微。谁能阐明限制指向哪个页面的最佳方法?

目前我所拥有的正在工作,但会导致我想要成为 https 的页面出现重定向循环。

<rule name="ForceNonHttps" stopProcessing="true">
    <match url="(.*)default/(.*)" ignoreCase="true" negate="true" />
    <conditions>
      <add input="{SERVER_PORT}" pattern="^443$" />
    </conditions>
   <action type="Redirect" redirectType="Found" url="http://{HTTP_HOST}{REQUEST_URI}" />
</rule>

【问题讨论】:

    标签: http iis https iis-8.5


    【解决方案1】:

    下面的重写规则对我很有用!

    <rule name="default.aspx HTTPS to HTTP" stopProcessing="true">
        <match url=".*" />
            <conditions logicalGrouping="MatchAny">
            <add input="{URL}" pattern="https://example.com/default.aspx$" />
        </conditions>
        <action type="Redirect" appendQueryString="false" url="http://example.com/default.aspx" redirectType="Permanent" />
    </rule>
    

    【讨论】:

      猜你喜欢
      • 2014-07-18
      • 2012-02-28
      • 2012-07-23
      • 2021-12-28
      • 2014-09-20
      • 2011-06-02
      • 2010-12-04
      • 2015-02-11
      • 1970-01-01
      相关资源
      最近更新 更多