/ Published in: Apache
Block automated spam bots from hitting your WordPress wp-comments-post.php file.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
RewriteEngine On RewriteCond %{REQUEST_METHOD} POST RewriteCond %{REQUEST_URI} .wp-comments-post\.php* RewriteCond %{HTTP_REFERER} !.*yourdomain.com.* [OR] RewriteCond %{HTTP_USER_AGENT} ^$ RewriteRule (.*) http://%{REMOTE_ADDR}/$ [R=301,L]