Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

 

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help.

 
Thread Tools
Old 06-19-2015, 03:47 PM   #1
Freedoom
Confirmed User
 
Industry Role:
Join Date: Feb 2006
Posts: 2,768
Geo redirect code

Hi,

I have this code to redirect traffic :

Code:
<?PHP
include('/home/domain/public_html/geoip/geoip.inc'); //this file must exist in your directory
 
$gi = geoip_open('/home/domain/public_html/geoip/GeoIP.dat',GEOIP_STANDARD);
 
// get the ip of the visitor
$addr = getenv('REMOTE_ADDR');
// translate his ip to a country code
$country = geoip_country_code_by_addr($gi, $addr);
// close the geo database
geoip_close($gi);
 
$badcountry = array('TR','IN','ID',"PK","CN",'MY');
// You can change the example with any countries that you want to block
 
// redirect them if they suck
if(in_array($country, $badcountry))
header('Location: http://www.domain.com/'); //enter a url or page on your site
?>
How can I redirect the "good" traffic(all the countries that aren't in the bad country array) to other url?

Thanks
__________________
List Of Sex Cams
Freedoom is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 06-20-2015, 08:23 AM   #2
CPA-Rush
small trip to underworld
 
Industry Role:
Join Date: Mar 2012
Location: first gen intel 80386/nintendo-gb/arcade/ps1/internet person
Posts: 4,927
header('Location: http://bye.com');
}
else
{
header('Location: http://welcome.com');
}
?>
__________________

automatic exchange - paxum , bitcoin,pm, payza

. daizzzy signbucks caution will black-hat black-hat your traffic

ignored forever :zuzana designs
CPA-Rush is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
 
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
redirect, code, bad, country, array, url, traffic, trafficall, geo, countries



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.