The Most Active and Friendliest
Affiliate Marketing Community Online!

“Propeller”/  Direct Affiliate

How do I redirect Specific Countries?

skypigeon

New Member
affiliate
How do I redirect Specific Countries? and other countries would not be redirected I tried googling it for hours. Unfortunately I did not find any... One even didnt work at all... thanks for your reply
 
Well you can use a Geo IP script and filter your traffic and redirect to various landing pages.
 
You can target more then just the country with bevo. like the state or down to the city and tracking them all from one platform.

This is one of the feature i use daily
2Q6J2.png



you get one link to give to your traffic source and it does all the work.
 
GEO Redirection..............


<?php
// Next two lines are for HostGator
require_once 'Net/GeoIP.php';
$geoip = Net_GeoIP::getInstance('GeoIP.dat');

try {
$country = $geoip->lookupCountryCode($_SERVER['REMOTE_ADDR']);

switch((string)$country) {
case 'GR':
$url = "http://xxx.html";
break;
case 'PH':
$url = "http://xxx.html";
break;

}

header('Location: '.$url);
} catch (Exception $e) {
// Handle exception
}
?>



HOw do i put this inside the html file??? I tried pasting it and it didnt work
 
GEO Redirection..............


<?php
// Next two lines are for HostGator
require_once 'Net/GeoIP.php';
$geoip = Net_GeoIP::getInstance('GeoIP.dat');

try {
$country = $geoip->lookupCountryCode($_SERVER['REMOTE_ADDR']);

switch((string)$country) {
case 'GR':
$url = "http://xxx.html";
break;
case 'PH':
$url = "http://xxx.html";
break;

}

header('Location: '.$url);
} catch (Exception $e) {
// Handle exception
}
?>



HOw do i put this inside the html file??? I tried pasting it and it didnt work

You need to put in a php file
 
what you could also do if you don't want to play with code. Just use bevomedia
its free and target and track what you want.
geo redirect Specific Countries.

k3Muq.png



then grab your destination url from bevo
IrNxa.png


then if you want it on your site, put it in a index.php

Code:
<?php

   header( 'Location: http://affportal-lb.bevomedia.com/direct_link/direct-link/id/VUDNIFLWUZR/adVar/a1' ) ;

?>
Change the code on the redirect page to be simply this. You need to replace the URL above with the URL you wish to direct to.

then it would redirect to the right geo country.
 
error:



Warning: require_once(/home/your-domain/php/Net/GeoIP.php) [function.require-once]: failed to open stream: No such file or directory in /home/utmdiftr/public_html/redir.php on line 4

Fatal error: require_once() [function.require]: Failed opening required '/home/your-domain/php/Net/GeoIP.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/utmdiftr/public_html/redir.php on line 4
 
Looks like you haven't installed the required Net_GeoIP package? These first 2 lines are looking for the Net_GeoIP files:
// Next two lines are for HostGator
require_once 'Net/GeoIP.php';
$geoip = Net_GeoIP::getInstance('GeoIP.dat');

What hosting are you using? Try to show them the website and ask if they can help you to install it.
 
MI
Back