<Directory "/var/www/web/">
Order deny,allow
Deny from all
All from example.com #允许某个域名
All from 10.0.0.1 #允许一个iP
All from 10.0.0.1 10.0.0.2 #允许多个iP
Allow from 10.1.0.0/255.255.0.0 #允许一个IP段,掩码对
All from 10.0.1 192.168 #允许一个IP段,后面不填写
All from 192.168.0.0/24 #允许一个IP段,网络号
</Directory>
参考地址:https://www.cnblogs.com/ginikeer/p/3696195.html