Sick of spammers? Of course, Akismet helps a lot, but your .htaccess file can also help: Today’s recipe is a snippet that prevent spam bots to directly access your wp-comments-post.php file, which is used to post comments on your blog.
Simply paste the following lines into your .htaccess file. This file is located at the root of your WordPress install.
Remember to always make a backup of your .htaccess file before editing it so, you’ll be able to restore it if something went wrong.
Don’t forget to replace yourdomainname on line 5 by your real domain name.
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_METHOD} POST RewriteCond %{REQUEST_URI} .wp-comments-post.php* RewriteCond %{HTTP_REFERER} !.*yourdomainname.* [OR] RewriteCond %{HTTP_USER_AGENT} ^$ RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L] </IfModule>
3 Comments
Thanks for sharing this information and resources its really help full for me with the help of this we can improve we design and development .
Thanks for sharing this information and resources its really help full for me with the help of this we can improve our design and development.
Web Design Company IndiaWow I must confess you make some very tencrahnt points.