Skip to content

Instantly share code, notes, and snippets.

@aardvark857
Created May 11, 2014 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aardvark857/da1bfcb8547fd8c135ad to your computer and use it in GitHub Desktop.
Save aardvark857/da1bfcb8547fd8c135ad to your computer and use it in GitHub Desktop.
Redirect FCC traffic to horrible sites.
//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