I am trying to figure out if it is possible to do a 301 redirect for a particular IP address (in this case brute force password bot). I want to send this guy to a project honeypot link rather than just banning the IP. Something like the following?

RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^xxx\.xxx\.xxx\.xxx
Redirect 301 ^/adminlogin/$ http://www.example.com/honeypotlink.php

marked as duplicate by Dennis Kaarsemaker, Dave M, Falcon Momot, colealtdelete, Jenny D Dec 2 '13 at 16:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


The RewriteCond has to be followed by a RewriteRule. And your RewriteCond has an ! which is a negation. It should look more like this:

RewriteEngine On
RewriteCond %{REMOTE_ADDR} ^xxx\.xxx\.xxx\.xxx
RewriteRule ^/adminlogin/$ http://www.example.com/honeypotlink.php [R=301,L]

Not the answer you're looking for? Browse other questions tagged or ask your own question.