Created
May 11, 2014 09:55
-
-
Save aardvark857/da1bfcb8547fd8c135ad to your computer and use it in GitHub Desktop.
Redirect FCC traffic to horrible sites.
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
//Not tested. I'll write a better one tomorrow. | |
<?php | |
//Sloppily get IP address | |
$ip = ip2long($_SERVER['REMOTE_ADDR']); | |
//Sloppily check against FCC addresses | |
if (( $ip >= ip2long("192.133.125.0") && $ip <= ip2long("192.133.125.24") ) || | |
( $ip >= ip2long("165.135.0.0") && $ip <= ip2long("165.135.0.16") ) || | |
( $ip >= ip2long("192.104.54.0") && $ip <= ip2long("192.104.54.24") ) || | |
( $ip >= ip2long("4.21.126.0") && $ip <= ip2long("4.21.126.0/24") ) || | |
( $ip >= ip2long("65.125.25.26") && $ip <= ip2long("65.125.25.64") ) || | |
( $ip >= ip2long("208.23.64.0") && $ip <= ip2long("208.23.64.25") )) { | |
//Redirect to some horrible site. You need to change the last line for this script to work. | |
header("Location: lemonparty.org || meatspin.cc || someOtherHorribleSite.whatevs"); | |
die(); | |
} | |
?> | |
//I am not responsible for what you do with this. Don’t do anything illegal. For educational purposes only. Fancy legal jargon. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment