ecstore或者bbc 前台不存在的控制器或者方法 报404页面

时间:2015-10-29 19:53:33   收藏:0   阅读:553

修改相关文件:cust技术分享om\site\lib\router.php

技术分享

技术分享

public function default_dispatch()

{
  $controller = app::get($this->_request->get_app_name())->controller($this->_request->get_ctl_name());
  $action = $this->_request->get_act_name();
  $query_args = $this->_request->get_params();

    if(method_exists($controller, $action)){
      try{
        call_user_func_array(array($controller, $action), (array)$query_args);

      }catch(Exception $e){
      if (defined(‘DEBUG_PHP‘) && constant(‘DEBUG_PHP‘)===true) {
        throw $e;
      }else{
        $this->http_status(500); //405页面
      }
    }
  }else{
    $this->http_status(404); //400页面 将此方法中的 400改为404 ok!
  }
}//End Function

404页面是在后台 站点->页面管理->异常页面管理->404页面 编辑产生

技术分享

 

技术分享

原文:http://www.cnblogs.com/phpyang/p/4921337.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!