how to redirect more than one country??
2015-03-25, 05:35 AM,
(This post was last modified: 2015-03-25, 05:35 AM by dice.)
#1
hello, i use this script and i want to redirect both french and canadian to a particular LP, let's say google.fr, and as you can see im already redirecting french people to .fr but i want to redirect canadian too
so what should i add to the script guys


Code:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>GEO Redirect Demo</title>
<!-- GEO Redirect -->
<script type="application/javascript">
function getgeoip(json){
if(json.country_code == "FR")
{
window.location = "http://google.fr"
}
else
{
window.location = "http://google.com"
}
}
</script>
<script type="application/javascript" src="http://www.telize.com/geoip?callback=getgeoip"></script>
</head>
<body>
</body>
</html>

thanx in advance

A good thing sells itself, a bad one advertises itself
Reply
2015-03-25, 05:51 AM,
#2
I am not sure if this is the correct answer but you maybe try to change

if(json.country_code == "FR")
to
if(json.country_code == "FR,CA")
Latest Thanks - View all

dice(2015-03-25 07:06 PM) 
Reply
2015-03-25, 07:56 AM,
#3
this one works best for me, you can try that


Code:
<!-- GEO Redirect -->
<script src="http://www.geoplugin.net/javascript.gp" type="text/javascript"></script>
<script type="text/javascript">

    switch(geoplugin_countryCode()){
        case "US" :
            document.location.href = "us llink";
            break;
        case "GB" :
            document.location.href = "uk link"
            break;
         default :
            document.location.href = "normal link"
            break;
    }
</script>
<!-- GEO Redirect -->

you can add more than 2 by adding before default:
Code:
case "GB" :
            document.location.href = "uk link"
            break;

hope that helps
Latest Thanks - View all

rajapk12(2015-03-27 09:16 PM) dice(2015-03-25 07:06 PM) 
Reply
2015-03-25, 07:00 PM,
#4
(2015-03-25, 07:56 AM)star79 Wrote: this one works best for me, you can try that


Code:
<!-- GEO Redirect -->
<script src="/javascript.gp" type="text/javascript"></script>
<script type="text/javascript">

    switch(geoplugin_countryCode()){
        case "US" :
            document.location.href = "us llink";
            break;
        case "GB" :
            document.location.href = "uk link"
            break;
         default :
            document.location.href = "normal link"
            break;
    }
</script>
<!-- GEO Redirect -->

you can add more than 2 by adding before default:
Code:
case "GB" :
            document.location.href = "uk link"
            break;

hope that helps

do i need to insert this code onto my webpage or create a separate html file for it?

A good thing sells itself, a bad one advertises itself
Reply
2015-03-25, 08:48 PM,
#5
(2015-03-25, 07:00 PM)dice Wrote:
(2015-03-25, 07:56 AM)star79 Wrote: this one works best for me, you can try that


Code:
<!-- GEO Redirect -->
<script src="/javascript.gp" type="text/javascript"></script>
<script type="text/javascript">

    switch(geoplugin_countryCode()){
        case "US" :
            document.location.href = "us llink";
            break;
        case "GB" :
            document.location.href = "uk link"
            break;
         default :
            document.location.href = "normal link"
            break;
    }
</script>
<!-- GEO Redirect -->

you can add more than 2 by adding before default:
Code:
case "GB" :
            document.location.href = "uk link"
            break;

hope that helps

do i need to insert this code onto my webpage or create a separate html file for it?

no need to create other pages, just put this code inside the <head> tag of the page.
Latest Thanks - View all

dice(2015-03-27 03:29 AM) 
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Landing Page [redirect] buzzshares 9 273 2017-10-02, 05:21 AM
Last Post: buzzshares
  [Question] Could a GEOIP Redirect be a reason for dangerous browser warnings? CheDz 1 96 2017-09-20, 03:42 PM
Last Post: zamnajali
  Country tier for CPA conversion? iNot 9 340 2017-08-04, 10:24 AM
Last Post: reshamanair
  Redirect on the Basis of Age? Qoins 1 131 2017-07-26, 06:18 PM
Last Post: YalaYolo
  How to Following Target People Country In Instagram? warrensandre25 4 286 2017-06-30, 02:01 AM
Last Post: ChrisRoark




About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2017 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top