Created
July 24, 2018 08:32
-
-
Save Kyngo/3535df749062711a46efe7a5a68b3aa6 to your computer and use it in GitHub Desktop.
Deny HTTP connections with PHP
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 ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) { | |
return true; | |
} else { | |
die("Unsafe connections are not allowed!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment