Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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