2

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
Rod
  • 33
  • 4
  • 1
    What are the headers when the issue *doesn't* occur? – TheDeadMedic Dec 13 '10 at 00:11
  • I have since tried to debug the site using Charles Web Debugging Proxy, and found that when Charles uses it's own certificate there is no problem. Is it possible the problem could be the actual certificate used by bluehost? – Rod Dec 13 '10 at 03:50
  • I think the problem might be down to `Connection: close`, when it should be `Connection: Keep-Alive` - this is based purely on the difference between the successful and unsuccessful response headers you've posted. – TheDeadMedic Dec 13 '10 at 19:09
  • The connection closing is the problem i am trying to fix. I tried putting "Connection: Keep-Alive" in the headers but it did not resolve the issue. – Rod Dec 13 '10 at 23:14

3 Answers3

1

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.

Rod
  • 33
  • 4
0

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

Scuzzy
  • 12,186
  • 1
  • 46
  • 46
  • No, when the issue occurs "Content-disposition: inline" is listed in the response headers – Rod Dec 13 '10 at 03:21
0

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>
James Anderson
  • 27,109
  • 7
  • 50
  • 78
  • The issue only occurs intermittently... but i tried your suggestion, it didn't seem to help. – Rod Dec 13 '10 at 06:46