Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have downloaded my access log file from my cPanel and found I have a bot I would like to stop. In the access log, there User-Agent string reads the following;

88.80.205.219 - - [08/May/2014:23:29:52 -0500] "GET / HTTP/1.0" 301 - "-" "-"
88.80.205.219 - - [08/May/2014:23:29:56 -0500] "GET / HTTP/1.0" 200 29019 "-" "-"

What is the proper format in my .htaccess file to block this bot only?

share|improve this question
1  
There is no user agent string in there –  John Conde May 9 at 19:20
    
Those are complete access log entries. The User-Agent is just the last part ie. "-" (a single hyphen, which probably represents an empty user agent string.) –  w3d May 9 at 20:20

1 Answer 1

To block all "blank" User-Agents or User-Agents consisting of a hyphen, you could use the following in your .htaccess

RewriteCond %{HTTP_USER_AGENT} ^-?$
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.