如何用.htaccess拒绝Spam机器人垃圾评论

将下面代码添加到网站根目录的.htaccess文件中可有效阻止Spam,另外将第4行改为你的。
# WPhtC: Protect comments.php RewriteCond %{REQUEST_METHOD} POST RewriteCond %{REQUEST_URI} .wp-comments-post.php* RewriteCond %{HTTP_REFERER} !.*https://note.minirizhi.com.* [OR] RewriteCond %{HTTP_USER_AGENT} ^$ RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]
