Created
October 25, 2014 08:16
-
-
Save heronyang/21493894f5eed6bdccd4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == "http") { | |
if(!headers_sent()) { | |
header("Status: 301 Moved Permanently"); | |
header(sprintf( | |
'Location: https://%s%s', | |
$_SERVER['HTTP_HOST'], | |
$_SERVER['REQUEST_URI'] | |
)); | |
exit(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment