Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My client has a VPS at Network Solutions. When looking at phpinfo() on a https:// page, I should be able to see the HTTPS server variable set to the string 'on' but the HTTPS variable does not exist. If I do a search for 'https' on the phpinfo() generated page, it only shows up next to 'Registered PHP Streams'

Maybe PHP was compiled without HTTPS support?

share|improve this question

2 Answers 2

Something other than httpd could be handling the HTTPS, so httpd doesn't know that it should set the variable.

share|improve this answer
    
How do I find out? –  Rob Decker Oct 27 '10 at 19:48
1  
Generally you'd ask the client. Presumably someone there should have some record of how the system is set up. –  Ignacio Vazquez-Abrams Oct 27 '10 at 19:52
    
Check _SERVER["SERVER_SOFTWARE"] on phpinfo()'s output. –  andyhky Oct 27 '10 at 19:53
    
I'd ask Network Solutions, but they are clueless. –  Rob Decker Oct 27 '10 at 21:44
    
The only thing in _SERVER["SERVER_SOFTWARE"] is Apache/2.2.6 (Fedora) –  Rob Decker Oct 27 '10 at 21:45

This is a response from Network Solutions regarding the matter:

Our proxy SSL doesn't allow server-side variables to detect HTTPS (secure). All server-side coding will always detect HTTP (non-secure), and for programs that attempt to redirect non-secure connections (http://) to a secure connection (https://) will result in an infinite loop and server error after 30 seconds.

The only ways around this is to assume the connection is secure by making all the links to the sensitive pages https, or use a client-side program (like javascript) to detect if it's secure and redirect if it's not. The coding below will do just that. Just modify it to redirect to the correct secure domain and add it into the HTML of any sensitive pages.

<script language="javascript"> if (document.location.protocol != "https:") { document.location.href = "https://secure.domain.com" + document.location.pathname; }; </script>

We also offer VPS hosting if you are comfortable with running your own server and it is a better suit for your needs.

Obviously not an ideal solution!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.