Jump to content

$_SERVER['HTTPS'] not enabled.


harryzhong

Recommended Posts

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

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.

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.

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.