页面是通过 SSL 下载而不是呈现

发布于 2024-10-07 22:34:09 字数 1063 浏览 6 评论 0原文

我使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

自控 2024-10-14 22:34:10

我发现问题是由我的 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.

脱离于你 2024-10-14 22:34:10

标题是否 header("Content-disposition: inline");帮助?

Does the header header("Content-disposition: inline"); help?

一杆小烟枪 2024-10-14 22:34:10

您需要告诉 apache 可以对 php 文件使用 SSL。

您在 extra/httpd-ssl.conf 中获得了正确的节吗?

它应该类似于:-

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

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

<FilesMatch "\.(cgi|shtml|phtml|php)$">
    SSLOptions +StdEnvVars
</FilesMatch>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文