-
-
Save carlohcs/68ca69cab0b2f916485b8ec1ddf6d2a9 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