Version: 1.01, by Hostboard
Developer Last Online: Oct 2023
Category: Administrative and Maintenance Tools -
Version: 4.2.0
Rating:
Released: 12-06-2012
Last Update: 02-05-2014
Installs: 22
Re-useable Code Additional Files
No support by the author.
There have always been a lot of requests on how to block certain countries from accessing sites due to SPAMMERS, and while there are various modifications here to help weed these wonderful individuals out, they are not fool proof and or cause too many false positives for some.
Another method is to utilize blocking of IP addresses. Unfortunately vBulletin does not support IP prefixes thus you have to either use wild cards or enter each and every IP address you want to block.
So we are left with utilizing .htaccess files as ultimately this might be the most secure way to block these individuals as they will never reach your site. You can even provide them with a custom message if you so desire as well. Of course this also can be circumvented with the use of open Proxy servers but at least we are making them jump through some hoops and possibly making them go find an easier target.
I have taken the zone files from regional IP space providers and listed them into a singular .htaccess file listing each country individually. By default nothing is blocked. All you need to do is to un-remark any country or singular IP address block. Typically what I do is when a spammer registers I look at the IP address then lock out that block trying not to limit the entire country.
This will work with ANY web site that is running an Apache web server or that can utilize a .htaccess file.
Zone files are typically 99.5% accurate and rarely change. I have made every attempt to be careful in compiling this into a single file. However I am human and do make mistakes so I take no responsibility if there is a bad entry or two in there.
7/12/2012
Initial release
2/5/2014
File updated with Gargamello's fixes to my typos.
Thanks Hostboard, I will experiment with that once I go live with the forum. I am on a linux server. How often would it be suggested to update that list?
Question, it looks like the list is a list of ip addresses within each country to block.
Is there a way to block the entire country? Or is there a way to only allow USA visitors in the htaccess file?
FYI, theWordPress plugin "IQ-Block-Country" uses a GeoIP.dat file. I am wondering if that is a list of IP addresses like in your file, but I was unable to open it with MS Office, Visual Studio, DreamWeaver and other programs. Do you know of any free programs to view a .dat file with? (I was unable to upload it with this post).
Thanks again so much!
If you remove the hash tag in front of the word deny under each countries entry you essentially will block that country. Remember this is not fool proof as open proxies are a dime a dozen and there are even other ways to circumvent this method of blocking. But at least it is something...
If you remove the hash tag in front of the word deny under each countries entry you essentially will block that country. Remember this is not fool proof as open proxies are a dime a dozen and there are even other ways to circumvent this method of blocking. But at least it is something...
Thanks Hostboard.
Sorry to sound so stupid. Can you give me a sample of the complete html code for any one country please. Thanks much!