由网友(先生)分享简介:时有可能发现iPhone的浏览器代理在.htaccess和用户重定向到正确的iPhone页面?解决方案 当然可以 - #REDIRECT移动浏览器的RewriteCond%{HTTP_USER_AGENT} ^ * iPhone。* $重写规则^(。*)$ http://mobile.yourdomain.com...![怎样在浏览器中打开本机文件在哪里](https://p.xsw88.cn/allimgs/daicuo/20230902/192.png)
时有可能发现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?
解决方案![怎样在浏览器中打开本机文件在哪里](https://p.xsw88.cn/allimgs/daicuo/20230902/192.png)
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
相关推荐
最新文章