GEO IP Redirecting?

Discussion in 'Site & Server Administration' started by xeros, Nov 7, 2010.

  1. #1
    Hey everyone,

    I would like to redirect every visitor to my website coming from a specific state, to another website.

    For example, if anyone visits my domain from the state of New York, and I want to redirect all New York visitors, they would all go directly to the other site and never see my site.

    Does anyone know how I can do this?

    Thank you so much!

    - Jennifer
     
    xeros, Nov 7, 2010 IP
  2. tolra

    tolra Active Member

    Messages:
    515
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    80
    #2
    tolra, Nov 7, 2010 IP
  3. Ryan-W

    Ryan-W Guest

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This can be done through Global Server Load Balancing (GSLB). GSLB is a technique that manages how clients connect to a datacenter when a service is hosted in multiple datacenters. A significant purpose of GSLB is to improve Customer Experience online; to load-balance each user to the best datacenter from a choice of several datacenters. The choice can be based on datacenter performance and proximity, so that clients are directed to the datacenter that is closest and is performing the best. This way, the client gets the best possible level of service.
     
    Ryan-W, Nov 8, 2010 IP
  4. jliu

    jliu Peon

    Messages:
    235
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you do go the route of using a geo-IP database such as MaxMind, just know that these databases can be wrong.
     
    jliu, Nov 15, 2010 IP
  5. st1905

    st1905 Well-Known Member

    Messages:
    573
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    135
    #5
    The database is %90 correct, you can get the city database http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz and use a webserver or a coding in php to redirect people from cities to specific places.
     
    st1905, Nov 19, 2010 IP
  6. nixproxy

    nixproxy Peon

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You will add this to your .htaccess or in to httpd.conf under the site vhost config.

    Here´s an example to redirect by country:

    # Redirect multiple countries to a single page

    RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(CN|KR|BR)$
    RewriteRule . city.html [L]

    Presumably you just replace that ENV to match the city. Check out Maxmind´s documentation for that.
     
    nixproxy, Dec 5, 2010 IP