我正在编写重写条件来检查用户代理。
1. The request should be from Mobile and
2. The request should not be from iphone/Black Berry/Android Device/ Windows Phone
我有一些这样的事情
RewriteCond %{HTTP_USER_AGENT} Mobile [AND]
RewriteCond %{HTTP_USER_AGENT} !"android|blackberry|IOS|windows phone" [NC]
有人可以纠正这个。
答案 0 :(得分:1)
RewriteCond %{HTTP_USER_AGENT} ^.*(Android|BlackBerry|iPhone|Windows Phone).*$ [NC]
RewriteRule ^(.+)$ /go_to_mobile_or_403/$1 [L]
源: http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html#HTTP_USER_AGENT