Reputation: 719
I'm using this line to match only certain browsers:
RewriteCond %{HTTP_USER_AGENT} !((Chrome|Firefox|Safari|Opera)\/\d+(\.\d+)*|(MSIE|Opera) \d+(\.\d+)*|Maxthon)
But for some reason it gives me error 500. I tried the regex with PHP's preg_match, and it works just as I intended... Does anyone know what the problem could be?
Note: I'm negating the condition because I want to ban other browsers.
Upvotes: 4
Views: 301
Reputation: 719
I solved it by replacing " " with \s in the regex. I had completely forgotten that a regular space basically jumps to another argument.
Upvotes: 1