Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Pushkar Gaikwad on
I am getting way too much useless traffic from some nations and I want to block them from accessing my site, How to do this ?
Comments
There is a module to block
There is a module to block by ip, see the troll. You could combine that with IP to country to implement blocking by country.
Will admin still be able to
Will admin still be able to view the site even if he is coming from that country which is blocked ?
since I am also from the same country ? that's why I don't want to use .htaccess blocking which is very easy but will also block me from using the site.
For you to be able to access
For you to be able to access the site you would need to have a fixed IP address and be able to white list it (not sure if the troll module can handle white listing). In addition the white list check would have to be before the ban ip/country check.
I do believe the troll
I do believe the troll module does have white list capabilities. However I would strongly caution blocking your own country. Unless you have a static IP then when and if your isp assigns you a new IP you will not be able to access your site and fixing it will be very very difficult once you are blocked.
Country Ban
Old thread but if someone else is looking for this like I was...
http://drupal.org/project/countryban