Q: How do I use htaccess to block computers when %{REMOTE_HOST} and %{REMOTE_ADDR} are the same? I have noticed that when %{REMOTE_HOST} and %{REMOTE_ADDR} are the same that the connecting computer is usually some form of bot.net or other hack attempt. The code I have is not working, but should give a feel for what I am looking for.
Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteCond %{REMOTE_HOST} =%{REMOTE_ADDR}
RewriteRule .* - [F]


A: You cannot use % variables on right hand side of RewriteCond directive.
This is tricky stuff but you can solve it with following rule using a back-reference:
RewriteEngine On

RewriteCond %{REMOTE_HOST}::%{REMOTE_ADDR} ^(.+?)::\1$
RewriteRule ^ - [F]

