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

how on earth do i geo redirect

Discussion in 'Making Money' started by Xyon81, Jun 18, 2009.

  1. Xyon81

    Xyon81 Regular Member

    Joined:
    May 27, 2009
    Messages:
    225
    Likes Received:
    18
    another noob thread, but i can't seem to find the answer on here, and google seems to only come up with options i have to pay for.

    Basically i just want to direct my UK traffic to a subdomain, is there a simple + free way to do this?
     
  2. ruler0fall

    ruler0fall Power Member

    Joined:
    May 17, 2009
    Messages:
    565
    Likes Received:
    263
    • Thanks Thanks x 1
  3. avi_31337

    avi_31337 Regular Member

    Joined:
    Jan 9, 2008
    Messages:
    266
    Likes Received:
    145
    Location:
    Planet Earth
    Here is my simple geo redirect page that I have coded myself using the free Maxmind API. Write this as an html file in the landing page, so that all the UK traffic get redirected to your subdomain address.

    Code:
    <script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
    
    
    <script language="JavaScript">
    
    var country= geoip_country_code();
    
    if(country  == "GB")      
    {
    <!--
    window.location = "YOUR SUBDOMAIN ADDRESS"
    //-->
    }
    </script>
    
    
    THANK ME IF U LOVE THE CODE
     
    • Thanks Thanks x 1