本页主题: 如何利用.htaccess自定义错误页面? 打印 | 加为IE收藏 | 复制链接 | 收藏主题 | 上一主题 | 下一主题

wsvip
级别: 管理员


精华: 3
发帖: 285
活跃度: 557 点
金钱: 2743 RMB
贡献: 0 点
注册时间:2006-10-11
最后登录:2009-01-08

 如何利用.htaccess自定义错误页面?

定义错误文档(Error Documents )
只需要在程序目录下建立.htaccess文件,用记事本打开文件按下面代码范例填写相应URL即可。


ErrorDocument 400 /errors/badrequest.html #定义400为http根目录下/errors/badrequest.html
ErrorDocument 404 http://yoursite/errors/notfound.html #定义404文档为http://yoursite/errors/notfound.html
ErrorDocument 401 “Authorization Required” #定义401文档直接显示Authorization Required



IE浏览器用户请关闭友好提示后查看效果。
捌号主机 专业FreeBSD主机Q386581
FreeBSD定制空间,100M-30G,满足你的建站需要!

顶端 Posted: 2008-09-18 10:58 | [楼 主]
帖子浏览记录 版块浏览记录
捌号主机论坛 » 捌号百问(FAQ)

Time now is:01-09 09:09, Gzip disabled 京ICP备06061602号
Powered by PHPWind v6.3.2 Certificate Code © 2003-08 PHPWind.com Corporation