.htaccess移动设备重定向
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了.htaccess移动设备重定向相关的知识,希望对你有一定的参考价值。
This rewrite covers most mobile devices (with few false positives). When a mobile device is detected it is redirected to /m/.
RewriteCond %{REQUEST_URI} !^/m/.*$ RewriteCond %{HTTP_USER_AGENT} !^.*ipad.*$ [NC] RewriteCond %{HTTP_ACCEPT} "text/vnd.wap.wml|application/vnd.wap.xhtml+xml" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "sony|symbian|nokia|samsung|mobile|windows ce|epoc|opera mini|nitro|j2me|midp-|cldc-|netfront|mot|up.browser|up.link|audiovox" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "blackberry|ericsson,|panasonic|philips|sanyo|sharp|sie-|portalmmm|blazer|avantgo|danger|palm|series60|palmsource|pocketpc" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "smartphone|rover|ipaq|au-mic,|alcatel|ericy|vodafone/|wap1.|wap2.|iPhone|android" [NC] RewriteCond %{REQUEST_URI} ^/$
以上是关于.htaccess移动设备重定向的主要内容,如果未能解决你的问题,请参考以下文章