htaccess “order” Deny, Allow, Deny

前端 未结 6 811
天命终不由人
天命终不由人 2020-12-04 06:44

I would like to allow only one country access, but exclude proxies within this country.

This is what I have (shortened version for convenience)



        
6条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 07:02

    Change your code to

    
    deny from all
    
    allow from 139.82.0.0/16
    allow from 143.54.0.0/16
    allow from 186.192.0.0/11
    allow from 186.224.0.0/11
    
    

    This way your htaccess will deny every except those that you explicitly allow with allow from..

    A proxy within the allow range can easily be overwritten with an additional deny from.. rule.

提交回复
热议问题