1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

[Tutorial] Easily block visitors by country using GeoIP PHP Extension

Discussion in 'Site & Server Administration' started by agnivo007, Jun 15, 2007.

  1. #1
    Hi everyone,

    Well, as the title says, this issue has been taken up here at DP many times; mainly by proxy website owners to block traffic from non-converting countries. Mostly, people manually ban IP address ranges through .htaccess which is really cumbersome and wastes valuable time.

    So, if you have your own VPS, dedicated server or your host can adjust PHP settings for you, feel free to follow my tutorial and block traffic from any country or region with a single line of PHP code that is nearly as fast and efficient as the .htaccess method, perhaps more accurate too!

    Here's the link to my tutorial : Block Non-converting, Spam Traffic by Country : GeoIP PECL PHP Geo-Targeting

    Feel free to Social Bookmark if you find it useful.

    Cheers! :)
     
    agnivo007, Jun 15, 2007 IP
    nessie and prilep like this.
  2. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Ahh..no reply or feedback? I thought this would be helpful to webmasters. :(
     
    agnivo007, Jun 16, 2007 IP
  3. inworx

    inworx Peon

    Messages:
    4,860
    Likes Received:
    201
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for this. But seems this section has not enough interest about it.

    I am tired post that GeoIP blocks a specific country. WIll lnik to this topic next time :)
     
    inworx, Jun 20, 2007 IP
  4. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks...please do so. Mostly in the proxy topics I guess ? ;)
     
    agnivo007, Jun 20, 2007 IP
    nikolaalx likes this.
  5. inworx

    inworx Peon

    Messages:
    4,860
    Likes Received:
    201
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yes, as at least every proxy has users from specific country which consumes GBs of bandwidth which is mostly Iran and China sine they have very strict rules in these..
     
    inworx, Jun 22, 2007 IP
  6. readme

    readme Banned

    Messages:
    103
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    US people has more strict rules against proxies rather then Iran and China. But it is true that there are loads of kids in Iran and China who cant see porn, most probably these sites are blocked there. So GBs of bandwidth goes for only Iran and China while porn pictures are heavy to load :)
     
    readme, Jun 22, 2007 IP
  7. nikolaalx

    nikolaalx Well-Known Member

    Messages:
    996
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    100
    #7
    thanks for the great guide ;)
     
    nikolaalx, Jun 23, 2007 IP
    agnivo007 likes this.
  8. wildcard

    wildcard Peon

    Messages:
    58
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Alternatively I am inviting you to look at blockacountry.com and use this service if denying access is what you are looking for.

    Enjoy,

    Wildcard
     
    wildcard, Jul 7, 2007 IP
  9. androomidaa

    androomidaa Well-Known Member

    Messages:
    649
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    110
    #9
    cool...the script helped. ill put it if in future there is no other to put it
    thanks anyways
     
    androomidaa, Jul 9, 2007 IP
  10. greatlogix

    greatlogix Active Member

    Messages:
    664
    Likes Received:
    13
    Best Answers:
    1
    Trophy Points:
    85
    #10
    Thanks. Nice tutorial. In fact you need a green.
     
    greatlogix, Jul 11, 2007 IP
  11. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Well, this can be done more easily and with less resource consumption using apache mod_geoip from maxmind.

    I'll post another tutorial using mod_geoip soon. :)
     
    agnivo007, Mar 7, 2008 IP