So im trying to redirect everyone coming to my site from third world countries and send them somewhere else.
Heres what im doing:
Adding this to htaccess, this an example with vietnamese ips.
<Limit GET>
order allow,deny
allow from all
deny from 58.186.0.0/15
deny from 116.68.128.0/21
deny from 116.96.0.0/12
deny from 116.118.0.0/17
deny from 116.193.64.0/20
deny from 117.0.0.0/13
deny from 122.201.8.0/21
deny from 123.16.0.0/12
deny from 125.212.128.0/17
deny from 125.214.0.0/18
deny from 125.234.0.0/15
deny from 202.6.2.0/24
deny from 202.6.96.0/23
deny from 202.47.142.0/24
deny from 202.60.104.0/21
deny from 202.78.224.0/21
deny from 202.79.232.0/21
deny from 202.92.4.0/22
deny from 202.134.16.0/21
deny from 202.151.160.0/20
deny from 202.172.4.0/23
deny from 203.77.178.0/24
deny from 203.99.248.0/22
deny from 203.113.128.0/19
deny from 203.113.160.0/19
deny from 203.119.8.0/22
deny from 203.119.36.0/22
deny from 203.119.44.0/22
deny from 203.128.240.0/21
deny from 203.160.0.0/23
deny from 203.160.96.0/21
deny from 203.161.0.0/22
deny from 203.162.0.0/21
deny from 203.162.8.0/21
deny from 203.162.16.0/20
deny from 203.162.32.0/19
deny from 203.162.64.0/18
deny from 203.162.128.0/20
deny from 203.162.144.0/20
deny from 203.162.160.0/19
deny from 203.162.192.0/18
deny from 203.171.16.0/20
deny from 203.176.160.0/21
deny from 203.190.160.0/20
deny from 203.191.8.0/21
deny from 203.191.48.0/21
deny from 203.210.128.0/18
deny from 203.210.192.0/18
deny from 210.86.224.0/20
deny from 210.245.0.0/19
deny from 210.245.32.0/19
deny from 210.245.64.0/18
deny from 218.100.10.0/24
deny from 218.100.14.0/24
deny from 220.231.64.0/18
deny from 221.121.0.0/18
deny from 221.132.0.0/18
deny from 221.133.0.0/19
deny from 222.252.0.0/14
</Limit>
So they will get a 403 error right? So i create a file called whatever.php and insert some php redirect code inside it:
<?php
header( 'Location: http://www.blahblah.com/blah.html' ) ;
?>
Then go back to htaccess to add a line so all 403's go to that file and should be redirected to the url inside the php redirect above:
ErrorDocument 403 /whatever.php
However when testing with a vietnamese proxy they are blocked but dont get redirected, instead just this:
Forbidden
You don't have permission to access /whatever.php on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
What am i doing wrong???
Heres what im doing:
Adding this to htaccess, this an example with vietnamese ips.
<Limit GET>
order allow,deny
allow from all
deny from 58.186.0.0/15
deny from 116.68.128.0/21
deny from 116.96.0.0/12
deny from 116.118.0.0/17
deny from 116.193.64.0/20
deny from 117.0.0.0/13
deny from 122.201.8.0/21
deny from 123.16.0.0/12
deny from 125.212.128.0/17
deny from 125.214.0.0/18
deny from 125.234.0.0/15
deny from 202.6.2.0/24
deny from 202.6.96.0/23
deny from 202.47.142.0/24
deny from 202.60.104.0/21
deny from 202.78.224.0/21
deny from 202.79.232.0/21
deny from 202.92.4.0/22
deny from 202.134.16.0/21
deny from 202.151.160.0/20
deny from 202.172.4.0/23
deny from 203.77.178.0/24
deny from 203.99.248.0/22
deny from 203.113.128.0/19
deny from 203.113.160.0/19
deny from 203.119.8.0/22
deny from 203.119.36.0/22
deny from 203.119.44.0/22
deny from 203.128.240.0/21
deny from 203.160.0.0/23
deny from 203.160.96.0/21
deny from 203.161.0.0/22
deny from 203.162.0.0/21
deny from 203.162.8.0/21
deny from 203.162.16.0/20
deny from 203.162.32.0/19
deny from 203.162.64.0/18
deny from 203.162.128.0/20
deny from 203.162.144.0/20
deny from 203.162.160.0/19
deny from 203.162.192.0/18
deny from 203.171.16.0/20
deny from 203.176.160.0/21
deny from 203.190.160.0/20
deny from 203.191.8.0/21
deny from 203.191.48.0/21
deny from 203.210.128.0/18
deny from 203.210.192.0/18
deny from 210.86.224.0/20
deny from 210.245.0.0/19
deny from 210.245.32.0/19
deny from 210.245.64.0/18
deny from 218.100.10.0/24
deny from 218.100.14.0/24
deny from 220.231.64.0/18
deny from 221.121.0.0/18
deny from 221.132.0.0/18
deny from 221.133.0.0/19
deny from 222.252.0.0/14
</Limit>
So they will get a 403 error right? So i create a file called whatever.php and insert some php redirect code inside it:
<?php
header( 'Location: http://www.blahblah.com/blah.html' ) ;
?>
Then go back to htaccess to add a line so all 403's go to that file and should be redirected to the url inside the php redirect above:
ErrorDocument 403 /whatever.php
However when testing with a vietnamese proxy they are blocked but dont get redirected, instead just this:
Forbidden
You don't have permission to access /whatever.php on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
What am i doing wrong???