Via: http://php.dzone.com/news/force-secure-page-using-php
//force redirect to secure page
if($_SERVER['SERVER_PORT'] != '443') { header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); exit(); }
Featuring rants unworthy of due consideration. Spell checked, but not proofread
Via: http://php.dzone.com/news/force-secure-page-using-php
//force redirect to secure page
if($_SERVER['SERVER_PORT'] != '443') { header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); exit(); }