首页
消防安全隐患排查和验收
域名转发系统
祺平订单系统
您所在的位置:首页 > PHP > 正文

Linux 系统 Apache 定义404错误页

316

增加.htaccess:

在httpd.conf中设置对目录开启。

AllowOverride All 

然后在目录里放一个.htaccess(.htaccess),添加:

errorDocument 404 /404.html

如果404.html的小于512字节的话,那么IE会认为这个错误页面不够“友好”,会忽视掉的!


通过修改httpd.conf:

修改 httpd.conf,找到:

#ErrorDocument 500 "The server made a boo boo."

#ErrorDocument 404 /missing.html

#ErrorDocument 404 "/cgi-bin/missing_handler.pl"

#ErrorDocument 402 http://www.example.com/subscription_info.html

httpd.conf中的这一部分,#ErrorDocument 404 /missing.html 是显示错误页信息的,去掉前面的#,修改为:

ErrorDocument 404 /404.html


重启 


本文网址:http://www.14study.cn/show.asp?id=71

若本文章侵犯了您的著作权,请联系我删除 QQ:695898855

更多>>网友评论
发表评论