【发布时间】:2013-09-04 00:04:55
【问题描述】:
有没有人尝试过使用Intelligencia.UrlRewriter 来实现 http 到 https 的重定向,反之亦然。我似乎无法让它在我的网站上运行。虽然我能够在 http 页面之间使用重写。
非常感谢。
【问题讨论】:
标签: c# url-rewriting rewrite
有没有人尝试过使用Intelligencia.UrlRewriter 来实现 http 到 https 的重定向,反之亦然。我似乎无法让它在我的网站上运行。虽然我能够在 http 页面之间使用重写。
非常感谢。
【问题讨论】:
标签: c# url-rewriting rewrite
这似乎对我有用,在 web.config 中:
<rewriter>
<if header="HTTPS" match="^OFF$">
<redirect url="(.*)" to="https://mydomain$1" />
</if>
</rewriter>
虽然我发现 IIS 和 MVC 至少设置 [RequireHttps] 将使用 302 自动处理 http -> https 重定向。
【讨论】: