With Apache and PHP, what’s the best way to know it, and to force using HTTPS?
I searched in phpinFO() for $_SERVER variables and found nothing that could help.
Edit: thanks for answers and suggestions! I can’t force it on server level because it’s only for login page.
$_SERVER['HTTPS']is non-empty if HTTPS was used. But you’d be better off doing the HTTPS enforcement at the webserver level, e.g.