1:找到apache配置文件:..../httpd-2.2.16/conf/httpd.conf
2:找到httpd.conf配置文件中你站点的根目录,如下:
# features.
#
<Directory "/home/app ">
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
#<Directory "/home/shangda/app/WEB-INF">
# Order deny,allow
/home/app即为跟目录,为你存放404页面的目录
3:去掉如下红色行的注释,将 missing.html改名为你设定的页面,并将该页面放进 /home/app 重启apache服务即可
# Some examples:
#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