【问题标题】:using Intelligencia.UrlRewriter for http to https and vice versa redirection使用 Intelligencia.UrlRewriter 进行 http 到 https 的重定向,反之亦然
【发布时间】:2013-09-04 00:04:55
【问题描述】:

有没有人尝试过使用Intelligencia.UrlRewriter 来实现 http 到 https 的重定向,反之亦然。我似乎无法让它在我的网站上运行。虽然我能够在 http 页面之间使用重写。

非常感谢。

【问题讨论】:

    标签: c# url-rewriting rewrite


    【解决方案1】:

    这似乎对我有用,在 web.config 中:

    <rewriter>
      <if header="HTTPS" match="^OFF$">
        <redirect url="(.*)" to="https://mydomain$1" />
      </if>
    </rewriter>
    

    虽然我发现 IIS 和 MVC 至少设置 [RequireHttps] 将使用 302 自动处理 http -> https 重定向。

    【讨论】:

      猜你喜欢
      • 2012-02-22
      • 2013-12-27
      • 1970-01-01
      • 1970-01-01
      • 2018-09-18
      • 2010-10-06
      • 2016-09-21
      • 2010-10-09
      • 2016-09-30
      相关资源
      最近更新 更多