Reputation: 432
I want to configure redirect if the user doesn't use Chrome, Safari, Opera or Mozilla.
For inverse problem (if I don't want Chrome etc.) there is a solution:
RewriteCond %{HTTP_USER_AGENT} Chrome
RewriteRule ^abcd.html$ chrome.html [NC,L]
RewriteCond %{HTTP_USER_AGENT} Safari
RewriteRule ^abcd.html$ safari.html [NC,L]
Adding !
before doesn't work
Upvotes: 2
Views: 1192
Reputation: 80657
Negation is done using the !
operator. Using the [NC]
flag will also discard strings like chrome
, chRome
etc:
RewriteCond %{HTTP_USER_AGENT} !Chrome [NC]
RewriteRule ^abcd.html$ chrome.html [NC,L]
Upvotes: 2