Does HTTP_HOST work as https ?

Will $_SERVER['HTTP_HOST'] be empty when a php script is accessed from a secure site ( ?
LVL 11
Who is Participating?
MatthewPConnect With a Mentor Commented:
It should do yes, but environment variables are often set by the server and can be different on a per server basis. You can normally use $_SERVER['HTTPS'] which may return a value of 'on' if the page is accessed by HTTPS. To see a list of all environment variables in your server, just put


in a php file and call it up through a browser by http and https and see what's available to you.

All Courses

From novice to tech pro — start learning today.