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

Easiest way to geo-block?

Discussion in 'Black Hat SEO' started by tony_d, May 12, 2015.

  1. tony_d

    tony_d Elite Member

    Joined:
    Jun 22, 2013
    Messages:
    2,583
    Likes Received:
    3,179
    Location:
    1600 Amphitheatre Parkway, Mountain View CA
    Any recommendations on the simplest way to geo-block users based on country, on a plain HTML site?

    I know you can block IP's in cPanel, but I want to block entire countries.
     
  2. pxoxrxn

    pxoxrxn Supreme Member

    Joined:
    Dec 21, 2011
    Messages:
    1,398
    Likes Received:
    2,073
    You can do this in ClouldFlare
     
    • Thanks Thanks x 1
  3. lancis

    lancis Elite Member

    Joined:
    Jul 31, 2010
    Messages:
    1,683
    Likes Received:
    2,427
    Occupation:
    Entrepreneur
    Location:
    Milky Way
    Home Page:
  4. tony_d

    tony_d Elite Member

    Joined:
    Jun 22, 2013
    Messages:
    2,583
    Likes Received:
    3,179
    Location:
    1600 Amphitheatre Parkway, Mountain View CA
    Just logged in to CF, and apparently geo-blocking is limited to Enterprise customers, spending more than $5k/mth.

    I'm certainly not paying them $5k/mth :p
     
  5. myopic1

    myopic1 Regular Member

    Joined:
    Mar 24, 2014
    Messages:
    408
    Likes Received:
    404
    Check out this site http://freegeoip.net

    If you're so inclined, having a coder work with their API opens up a number of possibilities, IP blocking being just one of them. You can detect city, latitude/longitude etc and then generate dynamic content based on that or whatever else your purposes might be...just another option but my first one would be to use one of the htaccess generators posted by Lancis.

    Just a note, this wouldn't prevent access to the website, the browser headers would be loaded and then the redirect or blocking would take place.
     
    • Thanks Thanks x 1
    Last edited: May 12, 2015
  6. pxoxrxn

    pxoxrxn Supreme Member

    Joined:
    Dec 21, 2011
    Messages:
    1,398
    Likes Received:
    2,073
    Why not? $5k/ month is just a cup of coffee a day.

    Go to Firewall and scroll down to Access Rules, fill in the box with the country you want to block and it should work.

    You can only challenge countries, not block.
     
    • Thanks Thanks x 1
    Last edited: May 12, 2015
  7. tony_d

    tony_d Elite Member

    Joined:
    Jun 22, 2013
    Messages:
    2,583
    Likes Received:
    3,179
    Location:
    1600 Amphitheatre Parkway, Mountain View CA
    Good luck with your $150 coffee :p

    Yeah, I can challenge, but want to block.

    Might go the path of serverside, but that's a bit more of a pain - not exactly 'user friendly' for someone like me.
     
    • Thanks Thanks x 1
  8. Conor

    Conor Elite Member

    Joined:
    Nov 7, 2012
    Messages:
    3,579
    Likes Received:
    5,965
    Gender:
    Male
    Location:
    South Africa
    Home Page:
    Do you have an .htaccess file? From what I know, there are certain IP ranges per country. So in theory you could find out what they are, and just add them to your .htaccess.

    http://www.parkansky.com/china.htm
     
    • Thanks Thanks x 1