检测iPhone浏览器在.htaccess / Apache和重定向到iPhone网站重定向、浏览器、网站、iPhone

由网友(先生)分享简介:时有可能发现iPhone的浏览器代理在.htaccess和用户重定向到正确的iPhone页面?解决方案 当然可以 - #REDIRECT移动浏览器的RewriteCond%{HTTP_USER_AGENT} ^ * iPhone。* $重写规则^(。*)$ http://mobile.yourdomain.com...

时有可能发现iPhone的浏览器代理在.htaccess和用户重定向到正确的iPhone页面?

解决方案

当然可以 -

  #REDIRECT移动浏览器
    的RewriteCond%{HTTP_USER_AGENT} ^ * iPhone。* $
    重写规则^(。*)$ http://mobile.yourdomain.com [R = 301]
    的RewriteCond%{HTTP_USER_AGENT} ^ *黑莓手机。* $
    重写规则^(。*)$ http://mobile.yourdomain.com [R = 301]
    的RewriteCond%{HTTP_USER_AGENT} ^ *掌* $
    重写规则^(。*)$ http://mobile.yourdomain.com [R = 301]
 

从这里

Is it possible to detect iPhone browser agent in .htaccess and redirect the user to the correct iPhone page?

解决方案 怎样在浏览器中打开本机文件在哪里

Sure you can -

   #redirect mobile browsers
    RewriteCond %{HTTP_USER_AGENT} ^.*iPhone.*$
    RewriteRule ^(.*)$ http://mobile.yourdomain.com [R=301]
    RewriteCond %{HTTP_USER_AGENT} ^.*BlackBerry.*$
    RewriteRule ^(.*)$ http://mobile.yourdomain.com [R=301]
    RewriteCond %{HTTP_USER_AGENT} ^.*Palm.*$
    RewriteRule ^(.*)$ http://mobile.yourdomain.com [R=301]

Taken from here

阅读全文

相关推荐

最新文章