http://www.blackhatworld.com/blackhat-seo/cloaking-content-generators/175546-free-geo-redirect-cloaking.html
<?php
include("geoip.inc");
$ip=$_SERVER['REMOTE_ADDR'];
$gi = geoip_open("GeoIP.dat",GEOIP_STANDARD);
$country_code = geoip_country_code_by_addr($gi, "$ip");
// Country name is not used so commented
// Get Country Name based on source IP
//$country = geoip_country_name_by_addr($gi, "$ip");
geoip_close($gi);
switch($country_code) {
case "US": header("Location: http://Your_American_page"); break;
case "CA": header("Location: http://Your_Canadian_Page"); break;
case "UK": header("Location: http://Your_U.K._Page"); break;
case "AU": header("Location: http://Your_Australian_Page"); break;
default: header("Location: http://Where_the_rest_of_the_visitors_go");
}
?>
You'll find the geoIP.dat database file and a bunch other includes on the maxmind website, get the free version for php, extract it, place it where the php file is and you're good to go with this little snippet
Add as many country codes / cases as you see fit and enjoy!
Code:<?php include("geoip.inc"); $ip=$_SERVER['REMOTE_ADDR']; $gi = geoip_open("GeoIP.dat",GEOIP_STANDARD); $country_code = geoip_country_code_by_addr($gi, "$ip"); // Country name is not used so commented // Get Country Name based on source IP //$country = geoip_country_name_by_addr($gi, "$ip"); geoip_close($gi); switch($country_code) { case "US": header("Location: http://Your_American_page"); break; case "CA": header("Location: http://Your_Canadian_Page"); break; case "UK": header("Location: http://Your_U.K._Page"); break; case "AU": header("Location: http://Your_Australian_Page"); break; default: header("Location: http://Where_the_rest_of_the_visitors_go"); } ?>
^^ +1
where is .inc file ??
hxxp://geolite.maxmind.c0m/download/geoip/api/php/geoip.inc
^^ +1
where is .inc file ??
Maybe if you guys take at least the little action it takes to download the actual package I suggested and -kindly- take the time to unzip it, chances are you'll find it, right?
This is a BH forum not kindergarten... lol