页面是通过 SSL 下载而不是呈现
我使用 Bluehost SSL 证书在我的网站上保护我的结账页面,并且该页面经常被下载而不是呈现。
仅当我使用 ssl 时才会发生这种情况,如果我在没有 ssl 的情况下运行网站,页面加载正常。
我可以采取什么措施来防止这种情况,我尝试将其放置
<?php header("Content-type: text/html"); ?>
在页面顶部,但这并不能解决问题。以下是出现问题时下载的文件标头的示例:
HTTP/1.1 200 OK
Date: Sun, 12 Dec 2010 23:42:18 GMT
Server: Apache
X-Powered-By: PHP/5.2.14
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
Vary: Accept-Encoding
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
以下是正确加载时的标头的示例:
HTTP/1.1 200 OK
Date: Mon, 13 Dec 2010 03:04:08 GMT
Server: Apache
X-Powered-By: PHP/5.2.14
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
Vary: Accept-Encoding
Keep-Alive: timeout=10, max=28
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
I have my checkout page secured on my site with the Bluehost SSL certificate and quite frequently the page will be downloaded instead of rendered.
This only happens when I use ssl, if I run the site without it the page loads fine.
Is there anything i can do to prevent this, I have tried placing
<?php header("Content-type: text/html"); ?>
at the top of the page but this doesn't solve the issue. Here is an example of the file headers that are downloaded when the issue occurs:
HTTP/1.1 200 OK
Date: Sun, 12 Dec 2010 23:42:18 GMT
Server: Apache
X-Powered-By: PHP/5.2.14
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
Vary: Accept-Encoding
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
Here is an example of the headers when it loads correctly:
HTTP/1.1 200 OK
Date: Mon, 13 Dec 2010 03:04:08 GMT
Server: Apache
X-Powered-By: PHP/5.2.14
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
Vary: Accept-Encoding
Keep-Alive: timeout=10, max=28
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我发现问题是由我的 css 和 javascript 压缩器脚本“CSS 和 Javascript Combinator”引起的。当我将其换成使用“Minify”时,问题得到了解决。
I found the issue was being caused by my css and javascript minifier script, "CSS and Javascript Combinator". When I swapped it out to use "Minify" the issue was resolved.
标题是否 header("Content-disposition: inline");帮助?
Does the header header("Content-disposition: inline"); help?
您需要告诉 apache 可以对 php 文件使用 SSL。
您在 extra/httpd-ssl.conf 中获得了正确的节吗?
它应该类似于:-
You need to tell apache its OK to use SSL with php files.
Have you got the correct stanza in the extra/httpd-ssl.conf
It should look something like:-