【问题标题】:Page is downloaded instead of rendered over SSL页面被下载而不是通过 SSL 呈现
【发布时间】:2010-12-13 00:06:11
【问题描述】:

我在我的网站上使用 Bluehost 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

【问题讨论】:

  • 当问题没有发生时,标题是什么?
  • 我后来尝试使用Charles Web Debugging Proxy调试站点,发现当Charles使用自己的证书时没有问题。问题是否可能是 bluehost 使用的实际证书?
  • 我认为问题可能归结为Connection: close,而应该是Connection: Keep-Alive - 这纯粹是基于您发布的成功和不成功响应标头之间的差异。
  • 连接关闭是我要解决的问题。我尝试将“Connection: Keep-Alive”放在标题中,但没有解决问题。

标签: php apache ssl bluehost


【解决方案1】:

我发现问题是由我的 css 和 javascript minifier 脚本“CSS and Javascript Combinator”引起的。当我把它换成使用“缩小”时,问题就解决了。

【讨论】:

    【解决方案2】:

    是否标头 header("Content-disposition: inline");帮忙?

    【讨论】:

    • 否,当问题发生时,响应标头中会列出“Content-disposition: inline”
    【解决方案3】:

    您需要告诉 apache 可以将 SSL 用于 php 文件。

    你有没有在 extra/httpd-ssl.conf 中找到正确的节

    它应该看起来像:-

    <FilesMatch "\.(cgi|shtml|phtml|php)$">
        SSLOptions +StdEnvVars
    </FilesMatch>
    

    【讨论】:

    • 这个问题只是间歇性出现......但我试过你的建议,它似乎没有帮助。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-12-05
    • 2011-06-26
    • 2017-05-30
    • 2010-09-09
    • 2012-09-18
    • 1970-01-01
    • 2012-11-03
    相关资源
    最近更新 更多