User agent for mobile application htaccess file

百般思念 提交于 2019-12-11 23:50:55

问题


I have done a jquery mobile application. Now i want to run the url in mobile device only and desktop device are shoeing false.

After a long time i am trying the htaccess file in application folder where the index.html is there.

mY htaccess file is

RewriteCond %{REQUEST_URI} !^/http://originalsite.com/.*$
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
RewriteRule ^(.*)$ /http://www.othersite.com/ [L,R=302]

NOW I can not get the effect in my site.

Is there something i missed here ?


回答1:


Try with those lines:

RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
RewriteRule ^(.*)$ http://www.othersite.com [L,R=302]


来源:https://stackoverflow.com/questions/9749109/user-agent-for-mobile-application-htaccess-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!