If you're using GeoLite as DB for blocking countries, installing mod_geoip and setting up mod_rewrite to deny requests from country ranges seems way more effective since this works with deny / allow before even PHP gets active.
Just mean it's useless to drop traffic via PHP since the traffic already reached it.
And about the other things - decent firewall and mod_security offer the same options in a way better way - including logging and all the other things.
Just my opinion - if one wants to block, best do it at the first levels (Firewall, Webserver) instead of the last levels (PHP script etc.)
Something like:
Quote:
GeoIPEnable On
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/message/
RewriteRule ^(.+) - [PT,L]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(US)$
RewriteRule ^(.*)$ http://www.your_domain.com/msg/error.html [L]
|
Will redirect all US users to /msg/error.html. Efficient, free and everything is logged in the access or error log of the Webserver before PHP even gets active.
Should be more efficient than letting PHP parse everything. Bots and Proxies - well - mod_security can take care of them