1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do I redirect certain country traffic to my CPA offer?

Discussion in 'Blogging' started by invest207, Mar 23, 2010.

  1. invest207

    invest207 Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 20, 2008
    Messages:
    543
    Likes Received:
    70
    Location:
    Mars
    Hi. I have a niche autoblog that send me great traffic from visitors based on: Germany, Austria and Switzerland.
    Because my autoblog content sucks I want to redirect all traffic coming from those 3 countries to a CPA offer.
    Please tell me what is the correct PHP script to use coz I am a total noob when it comes to PHP.

    Your help would be highly appreciated.
     
  2. speedy5044

    speedy5044 Regular Member

    Joined:
    Jul 29, 2008
    Messages:
    456
    Likes Received:
    993
    Occupation:
    IM
    If you have a shared hosting you can't do it , you need to install some application so you can do this .
    Take a look at this page , it explain alot obout using htaccess to redirect or block visitors.
    Code:
    http://htaccess.wordpress.com/2009/10/05/allow-block-country-htaccess/
     
  3. invest207

    invest207 Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 20, 2008
    Messages:
    543
    Likes Received:
    70
    Location:
    Mars
    My hosting is shared. I know that there are some simple PHP redirects that I insert in my wordpress template, I googled for some but most of them were incomplete.
     
  4. Booman666

    Booman666 Newbie

    Joined:
    Oct 11, 2009
    Messages:
    1
    Likes Received:
    0
    Maybe this PHP script can help you
    http://www.12scripts.com/demo/redirector/admin/login.php
     
  5. Gradimir Stankovic

    Gradimir Stankovic Power Member

    Joined:
    Jan 10, 2010
    Messages:
    737
    Likes Received:
    845
    Location:
    404 not found
    Here is one simple script I use, you can even target towns:
    HTML:
    <head>
    <script src="http://www.geoplugin.net/javascript.gp" type="text/javascript"></script>
    <script type="text/javascript">
        switch(geoplugin_countryCode()){
            case "AT" :
                document.location.href = "http://austriatraffic";
                break;
            case "CH" :
                document.location.href = "http://switzerlandtraffic"
                break;
            case "DE" :
                document.location.href = "http://germantraffic"
                break;
            default :
                document.location.href = "http://othertraffic"
                break;
        }
    </script>
    </head>
     
    • Thanks Thanks x 2