0

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
SLIM
  • 3
  • 1
  • 1
  • 4

1 Answers1

2

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]
etagenklo
  • 5,694
  • 1
  • 25
  • 31