GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   GEO Redirect script (https://gfy.com/showthread.php?t=924188)

camchoice 08-27-2009 05:57 AM

GEO Redirect script
 
Does anyone know of a good GEO redirect script ?

I need a script that can redirect a user to a domain when he comes from a certain country when he clicks a link. If he is not from that specific country he goes to the original URL ..

Axel XXX 08-27-2009 06:15 AM

IP2Location

camchoice 08-27-2009 06:24 AM

Quote:

Originally Posted by Axel XXX (Post 16240891)

I know, but thats just the database. I would need a script, or did I miss that ip2location script ?

StariaDaniel 08-27-2009 06:47 AM

Quote:

Originally Posted by camchoice (Post 16240906)
I know, but thats just the database. I would need a script, or did I miss that ip2location script ?

Well they offer it as a web service, but that could come pricy for a high traffic site:
http://www.ip2location.com/ip-country-web-service.aspx

Actually only redirection on country (ip based, which is not 100% precise) can be done pretty fast by an experienced webdeveloper.

There are even free databases like http://software77.net/geo-ip/ - but ip2location seems to be much more precise.

Pics Traffic 08-27-2009 06:52 AM

here we go buba..

geoip.inc

grab it here:

http://uploading.com/files/DJSN7JON/geoip.zip.html

include this in your redirect page(s):

($my_countries = array('cn,ru');) <- list of counties you want to redirect

PHP Code:

<?php
require_once('/home/html/path-to-site');

$gi geoip_open('GeoIP.dat'GEOIP_MEMORY_CACHE);
$country geoip_country_code_by_addr($gi$_SERVER['REMOTE_ADDR']);
geoip_close($gi);

$my_countries = array('tr');
if (
in_array(strtolower($country), $my_countries))
{
header('Location: http://go-away.com');
}

download this geoip file as well:

http://uploading.com/files/KWCOOPZR/GeoIP.dat.html

camchoice 08-27-2009 07:25 AM

I will try that out... many thanks !

donnie 08-27-2009 07:28 AM

Easiest way in my opinion is using Maxmind database and then define in your .htaccess file where you want to send visitors from certain countries. Very easy to do?

camchoice 08-27-2009 07:50 AM

I want to redirect them when they click a link.. It is simular to skimming traffic from galleries. So I think I need to create some kind of redirect url via a script.
Link > Script > Original URL or Redirect to my URL


All times are GMT -7. The time now is 08:08 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123