我在我的 htaccess 中添加了这个:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ^SemrushBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Yandex [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^rogerbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^exabot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^MJ12bot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^dotbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^gigabot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^AhrefsBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^CCBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^spbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Mjbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^MauiBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^SeznamBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Barkrowler [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^MegaIndex [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^AlphaBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Cliqzbot [NC,OR]
RewriteCond %{REQUEST_URI} wp-login.php$ [NC]
#RewriteRule .* - [L,F]
RewriteRule . - [F,L]
#RewriteRule ^.* - [F,L]
在我的访问日志中查找 MJ12bot 示例:
grep --text MJ12bot /var/log/apache2/access.log
我不应该看到 HTTP/1.1 403 结尾吗?
相反,我看到的是:
HTTP/1.1" 200 10841 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
是不是有什么地方出了问题?什么?
对于 wp-login.php 似乎有效,我看到:
HTTP/1.1" 403 24328 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1"
怎么了?