Redirect 302 HTTP重定向到移动子域的示例?

Redirect 302 HTTP重定向到移动子域的示例?,redirect,mobile,subdomain,Redirect,Mobile,Subdomain,有没有人有一个关于如何将移动用户重定向到m.example.com这样的子域的实际例子?我知道这最好是通过302HTTP重定向完成的,但我还没有遇到一个实际的例子 我想你是在寻找客户解决方案 编辑: 我刚在什么地方找到这个。它是为wordpress设计的,但我认为它可以添加到任何网站上 # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ -

有没有人有一个关于如何将移动用户重定向到m.example.com这样的子域的实际例子?我知道这最好是通过302HTTP重定向完成的,但我还没有遇到一个实际的例子

我想你是在寻找客户解决方案

编辑:

我刚在什么地方找到这个。它是为wordpress设计的,但我认为它可以添加到任何网站上

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Options +FollowSymlinks
RewriteEngine on
RewriteBase /

# prevent looping
RewriteCond %{HTTP_HOST} !^m.mysite.com$

# if the browser accepts these mime-types, it's definitely mobile, or pretending to be
RewriteCond %{HTTP_ACCEPT} "text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml" [NC,OR]

# a bunch of user agent tests
RewriteCond %{HTTP_USER_AGENT} "sony|symbian|nokia|samsung|mobile|windows ce|epoc|opera" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "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-"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "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]

# rewrite rules here
RewriteRule ^(.+)\$ http://m.mysite.com/$1 [R=302,NC]

你在用什么语言?语言?这是一个htaccess文件,但我不太明白如何让htaccess识别屏幕分辨率。