百度蜘蛛抓取首页问题,处理后报错,请官方及时处理

2016-07-07 15:19 来源:www.chinab4c.com 作者:ecshop专家

在处理百度蜘蛛模拟的问题的时候,


看了下管理员发的代码,我发现是
if(($ua == '' || preg_match($uachar, $ua))&& !strpos(strtolower($_SERVER['REQUEST_URI']),'wap'))


这句有问题,如果模拟蜘蛛没有指定HTTP_USER_AGENT或者$ua = strtolower($_SERVER['HTTP_USER_AGENT']);这句没有取到,那么$ua=='',这种情况下系统就跳转到wap首页,这个逻辑有问题,wap主页很多人没开也不是主流,去掉这个逻辑改成
  • if(( preg_match($uachar, $ua))&& !strpos(strtolower($_SERVER['REQUEST_URI']),'wap'))








出现下面的错误
ec.jpg


Warning: Cannot modify header information - headers already sent by (output started at D:\wwwroot\23book\wwwroot\index.php:1) in D:\wwwroot\23book\wwwroot\includes\init.php on line 166
Warning: Cannot modify header information - headers already sent by (output started at D:\wwwroot\23book\wwwroot\index.php:1) in D:\wwwroot\23book\wwwroot\includes\init.php on line 167
Warning: Cannot modify header information - headers already sent by (output started at D:\wwwroot\23book\wwwroot\index.php:1) in D:\wwwroot\23book\wwwroot\includes\cls_template.php on line 58


求官方给我解决方案,之前百度蜘蛛抓取的时候都很正常的,index.php也没有改过的。就今天发现这个问题

回答:
没有人知道么?