If you need to block or redirect requests that are originated from certain countries, here is a good method using geoIP information.

Install the GeoIP binaries and Apache module:
apt-get install geoip-bin libgeoip1 libapache2-mod-geoip
a2enmod geoip
service apache2 restart

Example of blocking requests from germby(DE) in a VirtualHost configuration:
SetEnvIf GEOIP_COUNTRY_CODE DE BlockCountry
Deny from env=BlockCountry

Example of redirecting of requests originated from germany(DE) or the United-States(US)
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(DE|US)$
RewriteRule ^(.*)$ http://www.myserver.com [R,L]

%d bloggers like this: