类似于这种网页的404状态码,他会主动调用服务器设置的404文件,如果没有设置这个文件就按cms的内容展示,下面介绍设置方法:
网址的404页面可以在服务器软件里面定义,我们以Nginx为例子,定义文件方式为:
代码如下:error_page 404 /404.html;
# 承接上面的location。
location = /404.html {
# 放错误页面的目录路径。
root /www/wwwroot/www.xunruicms.com/web;
}
那么404文件路径就是这样:/www/wwwroot/www.xunruicms.com/web/404.html
我们测试代码如下:html>
404body{
background-color:#444;
font-size:14px;
}
h3{
font-size:60px;
color:#eee;
text-align:center;
padding-top:30px;
font-weight:normal;
}
404,您请求的文件不存在!
再次访问之前的404页面就变成这样了
本文地址:https://www.xunruicms.com/doc/1045.html