Created
December 4, 2013 11:12
-
-
Save bramus/7785923 to your computer and use it in GitHub Desktop.
Enforce HTTPS
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 ((((int) $_SERVER['SERVER_PORT']) !== 443) && (!isset($_SERVER['HTTPS']) || ($_SERVER['HTTPS'] == 'off'))) { | |
| header("HTTP/1.1 301 Moved Permanently"); | |
| header('location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); | |
| exit(); | |
| } | |
| ?> | |
| <h1>Welkom op de https versie!</h1> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment