【问题标题】:Forcing HTTPS using IIS and ISAPI Rewrite使用 IIS 和 ISAPI 重写强制 HTTPS
【发布时间】:2011-04-01 22:00:59
【问题描述】:

我正在努力强制使用 HTTPS,如果用户使用的是 HTTP,则重定向用户。出于某种原因,我的重写规则在我的 prod env 上运行良好,但在我的 dev 上运行良好,这里是:

# Redirect HTTP to HTTPS# redirect all http requests  to https
RewriteCond  %HTTPS (?!on).*
RewriteCond Host: (.*)
RewriteRule (.*) https\://$1$2 [I,RP]

在 Prod 上效果很好,它可以重定向用户。在 Dev 上,它没有但显示这个非常奇怪的页面:

-cache
Content-Type: text/html
Content-Length: 161
Location: https://blahblah.mainblah.com/

<html><body>The requested resource was moved. It could be found here: <a href="https://blahblah.mainblah.com/">https://dev-notebox.intuit.com/</a></body></html>

有没有人看到这个或对这里发生的事情有任何想法/指示?

谢谢

【问题讨论】:

  • 您使用的是什么版本的 IIS?

标签: iis coldfusion iis-6 https isapi-rewrite


【解决方案1】:

如果页面是从 http 请求的,您可以使用&lt;cflocation&gt; 而不是使用重写。检查 Application.cfc 的 onRequestStart() 中的 CGI 范围。适用于所有 Web 服务器的纯 CFML 解决方案。

【讨论】:

    猜你喜欢
    • 2012-08-09
    • 1970-01-01
    • 2017-07-31
    • 1970-01-01
    • 2015-03-13
    • 2011-07-10
    • 2015-09-11
    • 1970-01-01
    • 2013-12-01
    相关资源
    最近更新 更多