harryzhong Posted June 10, 2008 Share Posted June 10, 2008 Hello All. I use a webhost for my company server and just purchased a geotrust SSL certificate. I used the company's control panel to paste in the CRT. They had me create a subdomain with a dedicated IP for the SSL, which I did and named the subdomain 'secure'. When I access the site via 'secure.mysite.com ' it shows me the lock icon and the cert info looks good. However, when I go into PHP and do a simple echo echo $_SERVER['HTTPS'] Nothing shows up, even though I'm using https. If I load phpinfo() via https, it shows my server port still as '80' and not as '433' which I've read is the SSL port? Does my host not have HTTPS recognition enabled? What could be happening here? Thanks for any help! Link to comment https://forums.phpfreaks.com/topic/109585-_serverhttps-not-enabled/ Share on other sites More sharing options...
jonsjava Posted June 10, 2008 Share Posted June 10, 2008 <?php $query=$_SERVER["QUERY_STRING"]; $file=$_SERVER["PHP_SELF"]; if($_SERVER["HTTPS"] != 'on') { header("Location: https://secure.mysite.com"); } ?> Link to comment https://forums.phpfreaks.com/topic/109585-_serverhttps-not-enabled/#findComment-562121 Share on other sites More sharing options...
harryzhong Posted June 10, 2008 Author Share Posted June 10, 2008 Thanks for the help jon that code just gives me an infinitely looping script. it never sees https because even if I type in 'https://secure.mysite.com' the $_SERVER['HTTPS'] variable is still not set, so it redirects again, and keeps going, never displaying anything. and why do you have the lines $query=$_SERVER["QUERY_STRING"]; $file=$_SERVER["PHP_SELF"]; Out of curiosity, I tried print $query and $file, the interesting thing is $query is empty while $file will give me the script filename. Link to comment https://forums.phpfreaks.com/topic/109585-_serverhttps-not-enabled/#findComment-562144 Share on other sites More sharing options...
jonsjava Posted June 10, 2008 Share Posted June 10, 2008 if you have a query string (example: ?page=1) it will add that back into the http://example.com/index.php?page=1 when it redirects it to https:// Link to comment https://forums.phpfreaks.com/topic/109585-_serverhttps-not-enabled/#findComment-562166 Share on other sites More sharing options...
PFMaBiSmAd Posted June 10, 2008 Share Posted June 10, 2008 It is acting like the subdomain was added using a mod_rewrite rule/redirect to map it to a folder rather than doing this at the DNS level. You will need to supply as much information as possible about what you have and what has been done. Link to comment https://forums.phpfreaks.com/topic/109585-_serverhttps-not-enabled/#findComment-562173 Share on other sites More sharing options...
harryzhong Posted June 10, 2008 Author Share Posted June 10, 2008 oh, that sounds about right. When I go to the control panel, the subdomain I have setup for the SSL has a forwarding location to a dedicated IP. so secure.mysite.com is forarded to xxx.xx.xxx IP. Is that what you mean? is there a way to see if my DNS settings are correct for the 'secure.mysite.com' ? Can I get a printout of all my DNS settings? There isn't an option in the control panel from my host. My host is netfirms btw. Thanks Jon & PFMaBiSmAd !! Link to comment https://forums.phpfreaks.com/topic/109585-_serverhttps-not-enabled/#findComment-562387 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.