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

修改相关文件:custom\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页面 编辑产生

 

posted @ 2015-10-29 18:11  洋洋豆奶  阅读(406)  评论(0编辑  收藏  举报