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

Script that redirects users based on location?

Discussion in 'Black Hat SEO' started by comoregion, Nov 21, 2013.

  1. comoregion

    comoregion Newbie

    Joined:
    Nov 26, 2012
    Messages:
    37
    Likes Received:
    5
    Occupation:
    Business Owner
    Location:
    Dallas, Texas
    Home Page:
    I'm looking for website script that will send users to different pages based on their location. For example, somebody from Switzerland visits the homepage. They would then be redirected to a page specifically designed for their country.

    I'm not sure if there's a script like this, but I have feeling there might be.

    All replies are appreciated.
     
  2. peetrike

    peetrike Power Member

    Joined:
    Aug 19, 2012
    Messages:
    585
    Likes Received:
    217
    Location:
    Estonia
    Search for cloakers. Here are some members who provide these for you.

    Cheers
     
  3. wkirk

    wkirk Junior Member

    Joined:
    Apr 3, 2011
    Messages:
    139
    Likes Received:
    67
    Here you go:

    Code:
    <?
    $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
    $country = geoip_country_code_by_name($_SERVER['REMOTE_ADDR']);
    $redirect=false;
    if (strstr(strtolower($hostname), ".ch")) { $redirect = true; };
    if (strtolower($country) == "ch") { $redirect = true; };
    
    if ($redirect) {
      header ("Location: http://google.ch");
    } else {
      header ("Location: http://google.com");
    };
    ?>
    
    
    
     
  4. Roshaen

    Roshaen Elite Member

    Joined:
    Sep 24, 2012
    Messages:
    2,238
    Likes Received:
    1,351
    Location:
    Please Pray For My DAD
    i guess there is a plugin WP geo redirect and you can build your own for a html with some free geo ip scripts.
     
  5. bartosimpsonio

    bartosimpsonio Jr. VIP Jr. VIP Premium Member

    Joined:
    Mar 21, 2013
    Messages:
    8,896
    Likes Received:
    7,488
    Occupation:
    ZLinky2Buy SEO Services
    Location:
    ⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩
    Home Page:
    You need to purchase a subscription to a geoip data service or a one time database purchase. Then you run some script like suggested by another member on this thread. Note, though, the geoip functions are not free of charge, you need to subscribe to some Geo IP solution.
     
  6. wkirk

    wkirk Junior Member

    Joined:
    Apr 3, 2011
    Messages:
    139
    Likes Received:
    67
  7. bartosimpsonio

    bartosimpsonio Jr. VIP Jr. VIP Premium Member

    Joined:
    Mar 21, 2013
    Messages:
    8,896
    Likes Received:
    7,488
    Occupation:
    ZLinky2Buy SEO Services
    Location:
    ⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩
    Home Page:
    That is correct, you only need subscription for the city level data(which is the one I used last time, so I remembered that one). I stand corrected.