1.修改配置文件
[root@www ~]# vim /etc/httpd/conf/httpd.conf
# 大約在 875 行左右,預設就是註解掉的!
# ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
# ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
# ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
# ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
....(後面省略)....
[root@www ~]# vim /etc/httpd/conf/httpd.conf
# 找到底下這一段,大約在 836 行左右,看看這些簡單的範例先:
#ErrorDocument 500 "The server made a boo boo."
ErrorDocument 404 /missing.html <==將註解拿掉吧!
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402
[root@www ~]# /etc/init.d/httpd restart
2.编辑错误显示页面
[root@www ~]# vim /var/www/html/missing.html
阅读(929) | 评论(0) | 转发(0) |