我试图让以下 2 个指令块一起工作,但由于某种原因,无论我按照什么顺序放置它们,该<Location>
块都优先于该块:<Files>
SetEnvIfNoCase User-Agent "baidu" badbot
SetEnvIfNoCase User-Agent "meanpath" badbot
SetEnvIfNoCase User-Agent "seoengbot" badbot
SetEnvIfNoCase User-Agent "spinn3r" badbot
SetEnvIfNoCase User-Agent "ahrefs" badbot
SetEnvIfNoCase User-Agent "yandex" badbot
SetEnvIfNoCase User-Agent "dotbot" badbot
SetEnvIfNoCase User-Agent "webtarantula" badbot
SetEnvIfNoCase User-Agent "spiderbot" badbot
<Location />
order allow,deny
allow from all
Deny from env=badbot
</Location>
<Files xmlrpc.php>
Order Deny,Allow
Deny from all
ErrorDocument 403 "Denied"
Allow from 127.0.0.1
# should be Wordpress.com allowed
Allow from 192.0.64.0/18
</Files>
当我删除第一个块时,xmlrpc.php 服务器范围内的访问被正确拒绝,当它再次进入时,它又被允许。有没有办法让这些指令和平共处?它是 CentOS 6.7 上的 Apache 2.2.29。