Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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, - - [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$ [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
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

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


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.