if ($_SERVER["HTTPS"] != 'on') { header('Location:https://secure.your_domain.com'.$_SERVER["REQUEST_URI"]); exit; }