Totally Zenned
- Join Date:
- Apr 2004
- Location:
- Montreal
- Posts:
- 584
- Plugin Contributions:
- 0
What is the best method to block country access?
I've read many things, but here is the grunt of it.
I want to block certain countries from access to a site. Either by ip when noted via logs due to certain bs, or an entire country.
using htaccess
I've started something like this, but I fear it can degrade server performance as well.
RewriteEngine on
RewriteCond %{HTTP:Accept-Language} (aa|ab|af|am|ar|as|ay|az|ba|be|bg|bh|bi|bn|bo|br|ca|co|cs|cy|dz|eo|et|eu|fa|fi|fj|fo|fy|gd|gl|gn|gu|ha|hi|hr|hu|hy|ia|ie|ik|in|is|iw|ji|jw|ka|kk|kl|km|kn|ks|ku|ky|ln|lo|lt|lv|mg|mi|mk|ml|mn|mo|mr|ms|mt|my|na|ne|oc|om|or|pa|pl|ps|qu|rm|rn|ro|ru|rw|sa|sd|sg|sh|si|sk|sl|sm|sn|so|sq|sr|ss|st|su|sw|ta|te|tg|th|ti|tk|tl|tn|to|tr|ts|tt|tw|uk|ur|uz|vi|vo|wo|xh|yo|zu) [NC]
RewriteRule .* http://www.whatever.com/noaccess.htm [R,L]
<Files *.php>
Order Deny,Allow
Deny from all
</Files>
<Files *.jsp>
Order Deny,Allow
Deny from all
</Files>
and so on, due to the ip list it is getting booksize like a rampant bunny...
So, somewhat lost and stuck...ideas anyone?