hui 模板自带的404页面 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>404</title> <link rel="stylesheet" type="text/css" href="__hui__/static/h-ui/css/H-ui.min.css" /> <link rel="stylesheet" type="text/css" href="__hui__/lib/Hui-iconfont/1.0.8/iconfont.css" /> </head> <body> <article class="page-404 minWP text-c"> <p><i class="Hui-iconfont va-m"></i> <span>404</span> </p> <p>不好意思,您访问的页面不存在~</p> <p>您可以: <a href="javascript:;" onclick="history.go(-1)">< 返回上一页</a> <span>|</span> <a href="/" class="c-primary ml-20">去首页 ></a> </p> </article> </body> </html>
config.php 配置文件
关闭调试模式
需要自己定义参数 路径就是这个路径index/view/exception/404.html
// 定义404错误的重定向页面地址 tp5.0设置
'http_exception_template' => [
404 => APP_PATH . 'index/view/exception/404.html',
],
// tp5.1设置
'http_exception_template' =>
[
404 => Env::get('app_path') . 'index/view/exception/404.html',
],
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号