Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a redirect rule in htaccess. This usually works just fine but in this case the bot/hacker has a blank user agent. The domlog shows,

xxx.xxx.xxx.xxx - - [30/Dec/2013:15:56:33 -0600] "POST /path/to/file.php HTTP/1.1" 301 426 "-" "-"

However the user is not actually being redirected. I know this from the logs, because they are not subsequently being sent to the appropriate place. I am assuming it has to do with the blank user agent but I am not sure.

My htaccess rule is,

RewriteEngine On
RewriteRule ^file.php$ http://www.example.com/otherfile.php [R=301,L]

Anyone know why this particular individual is not being redirected? And if there is a way to get around it?

share|improve this question
2  
It's a bot. It doesn't have to follow the redirect if it doesn't want to. –  Michael Hampton Dec 30 '13 at 22:43

1 Answer 1

Don't know exactly why it's not being redirected, however, you can try to block all empty user agents with this rule:

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
RewriteRule ^.* - [F]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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