How can I password prompt certain IPs and allow all others free access using Apache?
- by Moak
SOLVED:
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 222.249.128.0/19 china
SetEnvIf Remote_Addr 222.249.160.0/20 china
SetEnvIf Remote_Addr 222.249.176.0/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