• RewriteCond %{HTTP_HOST} ^www\.xxx\.com(.*)$
  • RewriteCond %{HTTP_USER_AGENT} "(baidu.Transcoder|mini|android|blackberry|googlebot-mobile|iemobile|Mobile|ipad|iphone|ipod|opera mobile|palmos|webos|ucweb|Windows Phone|Symbian|hpwOS)"
  • RewriteRule ^(.*)$ http://m.xxx.com/$1 [L,R=302]
  • - - RewriteCond %{HTTP_HOST} ^m\.xxx\.com(.*)$
  • RewriteCond %{HTTP_USER_AGENT} "!(baidu.Transcoder|mini|android|blackberry|googlebot-mobile|iemobile|Mobile|ipad|iphone|ipod|opera mobile|palmos|webos|ucweb|Windows Phone|Symbian|hpwOS)"
  • RewriteRule ^(.*)$ http://www.xxx.com/$1 [L,R=302]复制代码

.htaccess的方式,手机访问电脑跳手机,pc访问手机跳pc