Created
April 13, 2016 12:46
-
-
Save johnsiwicki/1d07acbea2115a5850651a4c4c8210bc to your computer and use it in GitHub Desktop.
https to http
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
| <?php | |
| if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'http') { | |
| $url = "https://". $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; | |
| header("HTTP/1.1 301 Moved Permanently"); | |
| header("Location: $url"); | |
| die(); | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment