备忘之--apache下为站点添加错误页面

环境:

  操作系统:ubuntu 10.04

   Apache版本:Apache/2.2.14 (Ubuntu)

打开文件 /etc/apache2/httpd.conf,添加

ErrorDocument  404  /missing.html

在ServerRoot下添加文件missing.html 里面写入找不到文件时显示的文本或something else。

注意是在根目录,如我的是在/var/www/missing.html

现在,在地址栏里随便输入一个主机上不存在的网址,将会弹出missing.html页面。

posted on 2011-02-06 15:30  Allan GC  阅读(130)  评论(0编辑  收藏  举报

导航