My current condition goin like that:
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
I wonder how can i swap this condition into "if not" one of the values above.
I tought about something like that:
RewriteCond %{HTTP_USER_AGENT} !="android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
but its doesnt work.
The problem is you've got a space between opera
and mobile
, which causes mod_rewrite to parse it as multiple parameters. Try using parentheses instead of quotes in conjunction with !
and escape the space:
RewriteCond %{HTTP_USER_AGENT} !(android|blackberry|ipad|iphone|ipod|iemobile|opera\ mobile|palmos|webos|googlebot-mobile) [NC]
Pretty close you don't need to add =
after the negation !
.
RewriteCond %{HTTP_USER_AGENT} !"android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]