ghurty Posted January 12, 2010 Share Posted January 12, 2010 How can you have it that a page checks if yiu are viewing it using http or https, and if only http, it will reroute you to https? Thanks Link to comment https://forums.phpfreaks.com/topic/188220-how-to-automatically-make-page-reroute-to-https/ Share on other sites More sharing options...
greatstar00 Posted January 12, 2010 Share Posted January 12, 2010 http://www.php.net/manual/en/reserved.variables.server.php $_SERVER['HTTPS'] Set to a non-empty value if the script was queried through the HTTPS protocol. Note: Note that when using ISAPI with IIS, the value will be off if the request was not made through the HTTPS protocol. As opposed to HTTP URLs which begin with "http://" and use port 80 by default, HTTPS URLs begin with "https://" and use port 443 by default. juse use header("Location: https://sample.com"): or <meta refresh="0:url=https://sample.com" /> Link to comment https://forums.phpfreaks.com/topic/188220-how-to-automatically-make-page-reroute-to-https/#findComment-993710 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.