ErrorDocument 403 /noaccess/countries.php?c=Nigeria
order allow,deny
allow from all
deny from 41.204.224.0/19
deny from 41.205.160.0/19
deny from 41.206.0.0/19
deny from 41.206.224.0/19
deny from 41.211.192.0/18
deny from 41.220.64.0/20
deny from 41.222.40.0/21
deny from 41.222.64.0/21
deny from 41.222.72.0/21
deny from 41.223.24.0/22
deny from 41.223.64.0/22
deny from 41.223.128.0/22
deny from 41.223.136.0/22
deny from 62.173.32.0/19
deny from 62.193.160.0/19
deny from 80.248.0.0/20
deny from 80.250.32.0/20
deny from 82.128.0.0/17
deny from 195.166.224.0/19
deny from 196.1.176.0/20
deny from 196.3.60.0/22
deny from 196.3.180.0/22
deny from 196.29.208.0/20
deny from 196.45.192.0/18
deny from 196.46.144.0/22
deny from 196.46.240.0/21
deny from 196.200.0.0/20
deny from 196.200.64.0/20
deny from 196.200.112.0/20
deny from 196.202.224.0/21
deny from 196.207.0.0/20
deny from 196.207.128.0/18
deny from 196.216.144.0/22
deny from 196.216.148.0/22
deny from 196.220.0.0/19
deny from 212.100.64.0/19
deny from 217.14.80.0/20
deny from 217.78.64.0/20
deny from 217.117.0.0/20
deny from 81.18.32.0/20
deny from 81.24.0.0/20
deny from 213.166.160.0/19
deny from 213.181.64.0/19
Hello, I use this in my .htaccess to block users from a certain country (Nigeria here) from accessing my website.
ErrorDocument 403 /errors/errors.php?c=Nigeria
order allow,deny
allow from all
#
deny from 41.204.224.0/19
deny from 41.205.160.0/19
...
deny from 213.166.160.0/19
deny from 213.181.64.0/19
It works perfectly for me, but I need to block other countries, I add ther subnets and ranges to the .htaccess file, but I want to have a specific redirect to each country.
I tried something like this:
ErrorDocument 403 /noaccess/countries.php?c=Nigeria
order allow,deny
allow from all
<IP addresses here>
ErrorDocument 403 /noaccess/countries.php?c=Kuwait
order allow,deny
allow from all
<IP addresses here>
But that failed, ideas please?