好象可以把404。htm替换掉来实现

解决方案 »

  1.   

    宇凡,请告诉我APACHE下的方法,不胜感激并一定给分
      

  2.   

    通过设定apache或者捕捉httpheader然后再判断跳转来实现!
      

  3.   

    ok在apache的配置文件(/apache/conf/httpd.conf)中的第835行开始#ErrorDocument 500 "The server made a boo boo.
    #  n.b.  the single leading (") s it as text, it does not get output
    #
    #    2) local redirects
    #ErrorDocument 404 /missing.html
    #  to redirect to local URL /missing.html
    #ErrorDocument 404 /cgi-bin/missing_handler.pl
    #  N.B.: You can redirect to a script or a document using server-side-includes.
    #
    #    3) external redirects
    #ErrorDocument 402 http://some.other_server.com/subscription_info.html
    #  N.B.: Many of the environment variables associated with the original
    #  request will *not* be available to such a script.这是默认的配置代码。你应该可以看出这里定义了三种常见的错误:500、404、402
    现在你需要做的是:把835行改为
    ErrorDocument 500 /missing.html
    把839行改为
    ErrorDocument 404 /missing.html
    把845行改为
    ErrorDocument 402 /missing.html然后在你的htdocs下建立一个missing.html文件。怎样做这个页面是你的事了~~:)然后重新启动你的apache,试试看效果吧~~:)