Created
August 20, 2013 15:43
-
-
Save addisonhall/6283199 to your computer and use it in GitHub Desktop.
PHP that successfully redirects http to https on Engine Hosting.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off") { | |
$redirect = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; | |
header("Location: $redirect"); | |
exit(); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment