利用这个cpanel的错误页工具,你就可以定制错误页面了。设置自定义404错误页,有两种简单的方法。

一,利用cpanel后台控制面板添加设置404自定义错误页的方法

步骤
1、登录cPanel后台
2、点击“错误页”(Error pages) – 点404 – 点save确定
3、进入FTP,在网站根目录public_html中,可以看见cPanel自动生成的404.shtml文件,自己下载编辑、添加需要实现效果的代码 – 完成。

二,利用.htaccess 设置404页面。
步骤:
1、做一个404的页面,命名为404.shtml,上传到网站根目录
2、.htaccess 加上下面的代码就可以了

ErrorDocument 404 /404.shtml

 

贴士:
错误页面的种类很多,最常见类型说明:

400 (语法错误)
401 (未通过验证)
403 (拒绝请求)
404 (找不到请求的页面)
500 (服务器内部错误)

.htaccess设置其它错误页面的代码参考:

ErrorDocument 403 /errordocs/error403.html
ErrorDocument 404 /errordocs/error404.html
ErrorDocument 500 /errordocs/error500.html

分享到: 更多

1
说点什么

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
0 Comment authors
Recent comment authors
  Subscribe  
最新 最旧 得票最多
提醒
trackback

新年快乐恭喜发财新年快乐恭喜发财

新年快乐 恭喜发财!