The idea is that if the visitor comes from China they have to pass a basic authentication. If you have any other IP address you can visit the site without being hassled (including proxies)
//1400 rules.... SetEnvIf Remote_Addr 126.96.36.199/19 china SetEnvIf Remote_Addr 188.8.131.52/20 china SetEnvIf Remote_Addr 184.108.40.206/20 china AuthType Basic AuthName "Restricted" AuthUserFile /www/passwd/users Require valid-user Order allow,deny Allow from All Deny from env=china Satisfy any
This is the code I use to allow all users, deny the ones form China and password prompt those:
AuthType Basic AuthName "Restricted" AuthUserFile /home/.htpasswds/.htpasswd Require valid-user Order Allow,Deny Allow from all deny from 220.127.116.11/15 .... deny from 18.104.22.168/18 satisfy any
No related posts.