0

我正在努力强制使用 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>

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

谢谢

4

1 回答 1

0

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

于 2010-08-20T23:20:21.920 回答