Forum Moderators: phranque
RewriteCond %{HTTP_USER_AGENT} ="" [OR]
RewriteCond %{HTTP_USER_AGENT} ^-$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
RewriteCond %{HTTP_USER_AGENT} !\( [OR]
RewriteCond %{HTTP_USER_AGENT} !\) [OR]
RewriteCond %{HTTP_USER_AGENT} \=
RewriteRule !^blocked/ /blocked/ua/ [L,NC]
RewriteCond %{HTTP_USER_AGENT} !Googlebot\-Image
RewriteCond %{HTTP_USER_AGENT} ="" [OR]
RewriteCond %{HTTP_USER_AGENT} ^-$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
RewriteCond %{HTTP_USER_AGENT} !\( [OR]
RewriteCond %{HTTP_USER_AGENT} !\) [OR]
RewriteCond %{HTTP_USER_AGENT} \=
RewriteCond %{HTTP_USER_AGENT} !RandomStringDoesNotMatterWhatItIs
RewriteCond %{HTTP_USER_AGENT} !Googlebot\-Image
RewriteRule !^blocked/ /blocked/ua/ [L,NC]
RewriteCond %{HTTP_USER_AGENT} !Googlebot\-ImageYou shouldn't need to escape the dash (-) in Googlebot-Image. In fact all you need is the "Googlebot" part.
RewriteCond %{HTTP_USER_AGENT} ^-?$ [OR]
RewriteCond %{HTTP_USER_AGENT} ="" [OR]
RewriteCond %{HTTP_USER_AGENT} \=
RewriteCond %{HTTP_USER_AGENT} !\( [OR]
RewriteCond %{HTTP_USER_AGENT} !\) [OR]
RewriteCond %{HTTP_USER_AGENT} !(Googlebot|RandomString)
RewriteRule !^blocked/ /blocked/ua/ [L,NC]
RewriteCond %{HTTP_USER_AGENT} ^-$ [OR]...should not block Googlebot-Image because it has an end anchor ($) meaning no more characters, so if your code was blocking Googlebot-Image, it is being blocked somewhere else. If your code was not blocking Googlebot-Image then leave out the !Googlebot-Image because it is not needed.