本帖最后由 Enjoy 于 2020-11-6 13:21 编辑
环境:LNMP
程序:帝国CMS
问题:网站手机端SSL后访问不断循环。
之前只是PC端做了,移动端没做,但是都是正常的,现在移动端https后,访问就无限循环的跳了
识别手机跳转代码:
<script type="text/javascript">
if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){
if(window.location.href.indexOf("?mobile")<0){
try{
if(/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry|iPad/i.test(navigator.userAgent)){
window.location.;
}
}catch(e){}
}
}
</script>
除了这个方法还有什么方法可以二级域名绑定目录
我测试了一个.htaccess代码,但是无效,代码如下:
RewriteEngine on
#设置m指向根目录的子目录/mphone
RewriteCond %{HTTP_HOST} ^m.baidu.com$
RewriteCond %{REQUEST_URI} !^/m/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /m/$1
RewriteCond %{HTTP_HOST} ^m.baidu.com$
RewriteRule ^(/)?$ m/ [L]
官方看看能不能帮帮忙
|
|