ecshop手机访问自己添加的页面会自动跳转到/mobile目录下

delzzz 2015-12-16 04:07:56
手机访问ecshop网站时,如何与网页版一致,不让其跳转到/mobile啊,+_+,网上都是说删除根目录下index的一段跳转mobile判断,(如下)
$ua = strtolower($_SERVER['HTTP_USER_AGENT']);

$uachar = "/(nokia|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|mobile)/i";

if(($ua == '' || preg_match($uachar, $ua))&& !strpos(strtolower($_SERVER['REQUEST_URI']),'wap'))
{
$Loaction = 'mobile/';

if (!empty($Loaction))
{
ecs_header("Location: $Loaction\n");

exit;
}

}
我已删了,可是无效= =,很奇怪的是,访问ecshop自带的页面时都正常,与网页版一致,就是自己添加的页面就会跳转到/mobile,然后出现wap版。。
...全文
1726 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
jueyan520 2019-02-27
  • 打赏
  • 举报
回复
源码在你手上还能折腾不出来,一个个断点慢慢试总能出来的
youyi7890 2019-02-25
  • 打赏
  • 举报
回复
折腾了好几天, 今天终于解决了。 includes/init.php下 有一条pc_to_mobile();的函数,删掉他就好了。 就可以显示当前的pc端页面了。
wangz15 2016-12-17
  • 打赏
  • 举报
回复
PC版正常,手机版不能访问 Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@xxxxxxxxx.my3w.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. 怎么回事?
coder11 2016-12-17
  • 打赏
  • 举报
回复
includes/init.php 初始化文件 /* 载入手机版系统参数 */ $_CFG_MOBILE = load_config_mobile(); 注释掉、试试
Gjanuary 2016-12-17
  • 打赏
  • 举报
回复
怎么改都行,千万别删除缓存文件否则你哭的心都有,楼主改的应该是对的要不你把moblile改成别的看看是不是也变
delzzz 2015-12-25
  • 打赏
  • 举报
回复
版本是2.7.3的..
lirenbing008 2015-12-21
  • 打赏
  • 举报
回复
引用 2 楼 delzzz 的回复:
wap关了就无法显示网站了
有没有外网地址 或者你用的是哪个版本的ecshop
delzzz 2015-12-21
  • 打赏
  • 举报
回复
wap关了就无法显示网站了
zhanghao1020 2015-12-16
  • 打赏
  • 举报
回复
后台wap设置里的wap功能关了吗

20,359

社区成员

发帖
与我相关
我的任务
社区描述
“超文本预处理器”,是在服务器端执行的脚本语言,尤其适用于Web开发并可嵌入HTML中。PHP语法利用了C、Java和Perl,该语言的主要目标是允许web开发人员快速编写动态网页。
phpphpstorm 技术论坛(原bbs)
社区管理员
  • 开源资源社区
  • phpstory
  • xuzuning
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧