CPAElites 2021 is coming! Finally! No more excuses! - Please click [here] to read more!

[TUTORIAL] Simple Geo Redirect Script
2017-06-11, 12:29 PM,
Hello Elites,

I wrote a comment in another thread about geo redirection and I saw some of you are confused about it. So I decided to share a really simple and of course free php script, to redirect your visitors to the correct CPA offer based on their country. You know, if you promote an offer where only USA visitors are allowed, then your visitors from other countries are redirected somewhere else, to a different offer, which often not related to your main offer. So best option is to pick you your offers for all the targeted countries and redirect them by yourself! Some networks has a builtin tool to do this, but sometimes there isn't.

Of course no one wan't to pay for such a simple thing, which can be made in 5 minutes. But I know, most of you don't have programming knowledge, so I share this script with you.

Let's get started:

Log in to your FTP client and locate the folder where you want to place your redirect script. Make a new file with .php extension, let's name it redirect.php

Place the following code inside:

PHP Code:

if (
header'Location:' ) ;
else if (
header'Location:' ) ;
else if (
header'Location:' ) ;
else if (
header'Location:' ) ;
else if (
header'Location:' ) ;
else if (
header'Location:' ) ;
else if (
header'Location:' ) ; 
else if (
header'Location:' ) ; 
header'Location:' ) ;

The URLs in the code are just examples!!! CHANGE it to your own offer URLs.

You can see, the code is really simple. The $countrycode variable contains the code of visitors country. So you can just check it, wheter it matches with some countries, or not.

The last "else" contains the case, if none of the above countries matches you visitors country. Then your visitor will be redirected to here. This is a default case URL, so if you pick offers for 10 countries, then all of the visitors from the remained countries will be redirected here.

You can easily add new countries, just add a new "else if", above the last "else".
For example:

PHP Code:
else if ($countrycode=='IN')
header'Location:' ) ; 
else if(
header'Location:' ) ; 
header'Location:' ) ; 

The country codes can be found here:

2017-06-11, 01:02 PM,
Thanks bro! Giving you +rep :D
2017-06-11, 08:12 PM,
thanks very much for this code
2017-06-11, 08:24 PM,
Great mate! Thanks I'll find use for this for sure :) Cool

↘ Best CPA for Desk/Mobile Traffic! ↙

[Image: ieDLPOR.png]


2017-06-11, 09:33 PM,
Great share Bro. Geo IP targeting is a great method. to convert and rotate offers. according to IP.
And u shared with a full description that how to do it.
Thanks, BRO.
2017-06-12, 11:55 PM,
thanks, great script, appreciate your work
2017-06-15, 04:17 AM,
2017-06-15, 07:31 AM,
Thank you! Great share!!
2017-06-15, 09:27 AM,
Woah, I'm looking for this code everywhere and finally found it here. You're truly awesome, @Wyctus :)
2017-06-15, 02:01 PM,
(2017-06-15, 04:17 AM)walterzingo Wrote: I DON'T UNDERSTAND, MORE EXPLANATION PLEASE.

Which part isn't clear?

Related Threads
Thread Author Replies Views Last Post
  [GET] CamChat Script Dario 18 5,858 2020-12-26, 02:41 AM
Last Post: TokyoDesu
  PHP Script to Block Bad Traffic - Proxy/Bot/VPN/TOR TikadoKan 16 6,911 2020-09-23, 08:09 PM
Last Post: eevilcag
  [FREE] Cloak Script Watt 129 24,377 2020-09-13, 04:27 AM
Last Post: wongbodo
  [Tutorial] How to make money using Instagram + CPAgrip manjeet036 284 140,734 2020-08-18, 02:02 PM
Last Post: max2arab
  {Get} Viral CPA Script (built in Referral system and Locker) cashhacker 104 28,437 2020-07-29, 07:04 PM
Last Post: schausnegl

About Us | Contact Us | CPAElites | Advertise | Stats

Copyright © 2013 - 2021 by (company to be announced later)
Temporarily (!) powered by MyBB, fixed (repaired), enhanced and operated by Charlie Harper (GitHub) aka Charles Francis Harper (Wikipedia) - CPAElites - CPAElites session ranking test
Return to top
This forum uses Lukasz Tkacz MyBB addons.