cPanel设置自定义404错误页的方法?.htaccess如何设置404页面?

By | Jun 17, 2010

利用这个cpanel的错误页工具,你就可以定制错误页面了。设置自定义404错误页,有两种简单的方法。
一,利用cpanel后台控制面板添加设置404自定义错误页的方法[/b]
步骤
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

VN:F [1.9.11_1134]
Rating: 5.0/5 (2 votes cast)
VN:F [1.9.11_1134]
Rating: 0 (from 0 votes)
cPanel设置自定义404错误页的方法?.htaccess如何设置404页面?, 5.0 out of 5 based on 2 ratings
1 Comment so far
  1. 爱问 June 8, 2011 1:27 pm

    .htaccess 设置404页面。改这个很方便,谢谢

    VA:F [1.9.11_1134]
    Rating: 5.0/5 (1 vote cast)
    VA:F [1.9.11_1134]
    Rating: 0 (from 0 votes)

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments

Spam Protection by WP-SpamFree

© 2007 Cpanel中文教程使用指南 -