【发布时间】:2015-05-21 09:05:12
【问题描述】:
通过移动设备访问时,我将我的网站重定向到移动网站。
这是 htaccess 代码:
RewriteCond %{QUERY_STRING} !^desktop
RewriteCond %{HTTP_USER_AGENT} android|avantgo|blackberry|iphone [NC]
RewriteRule ^ http://m.example.com%{REQUEST_URI} [R,L]
FTP的文件夹结构是这样的:
Images
ProImages
Mobile // All mobile site data into this
当我尝试从我的移动网站访问http://www.example.com/ProImages/abc.jpg 时,它不会显示,因为它一旦尝试调用www,就会重定向到m。
我尝试使用../ProImages,但同样没有解决问题。
有人可以帮忙吗?
【问题讨论】:
-
这是正确的行为,因为您的规则基于
HTTP_USER_AGENT进行重定向。为防止重定向,您可以使用此 URL:ttp://www.example.com/ProImages/abc.jpg?desktop