.htaccess

WordPress Htaccess

Here are my favorite .htaccess codes for WordPress

RewriteEngine On
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
RewriteCond %{HTTP_REFERER} !.*domainname.com.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]

This one helps block spammers from sniffing out your wordpress and post random comments.

RewriteEngine On

order allow,deny
deny from all

Helps protect your .htaccess from intruders.

10/05/11 by Miles