【问题标题】:Redirect https to http using rewrite rule in webconfig file使用 Web 配置文件中的重写规则将 https 重定向到 http
【发布时间】:2013-08-09 03:55:48
【问题描述】:

这是我迄今为止尝试过的。

 <rule name="https main site to http" stopProcessing="true">
       <match url="^(.*)$" ignoreCase="true" />
       <conditions>
            <add input="{HTTPS}" pattern="Off" />
       </conditions>
       <action type="Redirect" url="http://{HTTP_HOST}/{REQUEST_URI}" />
 </rule>

如何将https://www.mysite.com 重定向到http://www.mysite.com

【问题讨论】:

  • 它是如何失败的?什么都没有发生?是否在 IIS 中启用了规则?
  • 是的,在 IIS 中启用了规则

标签: c# .net vb.net rewrite


【解决方案1】:

这是很久以前提出的问题,但看起来已经在这里回答了:How to force HTTPS using a web.config file。如果您使用完整答案,请密切注意其中提到查询字符串会附加两次的 cmets。

【讨论】:

    猜你喜欢
    • 2013-06-02
    • 1970-01-01
    • 2016-12-28
    • 2015-12-26
    • 2014-11-04
    • 2015-08-10
    • 2019-08-03
    • 2016-12-29
    • 2016-10-13
    相关资源
    最近更新 更多