How To Setup GEO Targeting Redirects Using Cloud Flare

Have you ever purchased paid advertising where the traffic came from a number of different countries but your offer was only available for specific countries. Perhaps you are involved in CPA marketing and are promoting an offer that has different links for traffic from different countries. Every wish there was a way to separate the traffic and redirect it to the most relevant offers from one link. This video below explains how to setup geo location redirects using cloud flare and a very simple PHP scrips.

Follow the instructions exactly. Here is the script below. To use this script copy and paste this source code in a text pad. Save as .php file and upload this to your web host.


<?php $country_code = $_SERVER[“HTTP_CF_IPCOUNTRY”];

if ($country_code==”US”) {
$link = ‘‘;

elseif ($country_code==”GB”) {
$link = ‘‘;

elseif ($country_code==”UK”) {
$link =‘;

else { $link = ‘‘;



For a list of country codes message me on facebook.

Add a Comment

Your email address will not be published. Required fields are marked *