#Force redirect to secure page # //force redirect to secure page if($_SERVER['SERVER_PORT'] != '443') { header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); exit(); } // Or <?php header( 'Location: http://redirectedURL.com' ) ; ?>