我正在努力强制HTTP,如果用户在HTTP上,请重定向用户。由于某种原因,我的重写规则在我的产品环境中效果很好,但我的开发人员却不是:这里是:

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

在产品上它运行良好,它将用户重定向。在开发人员上,它不会显示这个非常奇怪的页面:

-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>

有没有人看到过这一点,或者对这里发生的事情有任何想法/指示?

谢谢

有帮助吗?

解决方案

而不是使用重写,您可以使用 <cflocation> 如果从HTTP请求该页面。在application.cfc中检查CGI范围 onRequestStart(). 。纯CFML解决方案将在所有Web服务器中起作用。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top