linux php404错误,Linux 系统 Apache 定义404错误页

增加.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

重启

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值