[Video] How to Redirect Traffic Based On Country Origin.

0 replies
I originally intended to use this video to gain subscribers to my list. I wasn't satisfied and didn't feel like scripting a video. I just don't have the time anymore.

I remember it taking me forever to figure out how to do this. It may be useful to some of you.

In the video I mentioned you can contact me for support. Sorry guys I just do not have the time to offer service or support. The video is easy to follow. Even if it is unscripted. Enjoy.

How To Redirect Web Traffic Based on Country Origin with CloudFlare - YouTube

Notes: Make sure your domain is already pointed to your host before you setup cloudflare.

Notes:You will not able to access your domain name cpanel directly through your domain name. You have to access your cpanel through the sites IP address. Also for ftp access type in ftp.yourdomain.com in your ftp client.

Notes: I do not recommend anyone host blogs using cloudflare dns. I noticed some problems with cache pages.


Save this in a txt document with .php extension

<?php

$country_code = $_SERVER["HTTP_CF_IPCOUNTRY"];

if ($country_code=="US") {
$link = 'http://www.google.com';
}
if ($country_code=="US") {
$link = 'http://www.yahoo.com';
}
if ($country_code=="US") {
$link = 'http://www.bing.com';
}
else {
$link = 'http://www.ask.com';
}

header("location:$link");
exit;
?>

If you want to add more countries just add this.

if ($country_code=="US") {
$link = 'http://www.bing.com';
}


These lines below will send all other traffic from unspecified countries to $link url.

else {
$link = 'http://www.ask.com';
}


List of country codes

Take Care.
#based #redirect #traffic #video

Trending Topics