0

this is what identifies this browser in the apache log

"Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Firefox/31.0"

what should the correct syntax be ?

RewriteCond %{HTTP_USER_AGENT} "Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Firefox/31.0"

1 Answers1

0

Don't make an exact match on the user agent because it can vary slightly and the test will then fail for the same browser version. To exclude Firefox version 31, match just on the substring as

RewriteEngine on

RewriteCond %{HTTP_USER_AGENT} \ Firefox/31 [NC]
RewriteRule ^ - [F,L]

Now, the browser will receive a 403 Forbidden error.

Ravi K Thapliyal
  • 51,095
  • 9
  • 76
  • 89