-1

how can i write rewrite condition for wildcard user agents

here is the code I'm trying but doesnt work

  RewriteCond %{HTTP_USER_AGENT} !*uTorrent* [NC]
  RewriteCond %{HTTP_USER_AGENT} !*BitTorrent* [NC]
  RewriteCond %{HTTP_USER_AGENT} !*Transmission* [NC]

The problem is user agents are in this format

uTorrent/12345
Bittorrent/2456
Transmission/"SomeRandomNumbers"

How can i write a proper (RewriteCond) Rewrite Condition ?

Niresh
  • 103
  • 4

1 Answers1

0

In htaccess to Allow Downloads from Specific User agent and HTTP Referrer, I already explained that (1) Your regular expressions are invalid, because you're misusing the * character (hint: it's not a wildcard), and (2) the regexes will work as you intend if you just remove the *s.

You should familiarize yourself with regular expressions. The mod_rewrite introduction to regular expressions is a good place to start.

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47