The Most Active and Friendliest
Affiliate Marketing Community Online!

“Adavice”/  “1Win

Do you know any "url shortener script" that redirect based on country?

heartdragon

New Member
affiliate
Hi, I need one of this script but i found that they dont have the option of geo redirect.
Do you know any alternative? Open source or cheap. Many thanks!
 
OpenAff/geoip-js
GeoIP2 JavaScript Tutorial « MaxMind Developer Site
_______________________________
I coded my own GEO location using the MaxMind GeoLite2-City.mmdb database locally for tracking purposes (mainly)

you need to assign a country code to each ip and redirect
PHP:
//$ip_code returns 'FR'
$pages = array(
 'https://example_com/2/us' => 'US',
 'https://example_com/2/fr' => 'FR' //<this one
);
                $page_location = array_search($ip_code,$pages);
                                        header("Location: $page_location");

the URL should be a server rewrite to keep it simple e.g.; example_com/2/fr

Hire a coder or learn to code -- this *can* all be done in a JavaScript too ;)
 
MI
Back