1.关闭调试模式, 设置部署模式:
// 应用调试模式'app_debug'=> false,// 应用Trace'app_trace'=> false,
2.找到:
// 异常处理handle类 留空使用 \think\exception\Handle'exception_handle' => '',
在其下面添加:
'http_exception_template'=>[// 定义404错误的重定向页面地址404 =>APP_PATH.'404.html',// 还可以定义其它的HTTP status401 =>APP_PATH.'401.html',],