Home » Apache解错方案 » 让apache支持自定义404页面错误
让apache支持自定义404页面错误
2009-02-12 16:09:48 | 才被看了652次 | 要评论?
分类: Apache解错方案 | 发布: OurApache | 来源:大喜吧
Tags: 404,rewrite
在rewrite开启的情况下,当URL发起请求的页面在服务器端不存在的时候,返回http status code ==400;
而通常文件没有找到应该返回404状态码,查询N久无解中,关闭rewrite一切正常
在VirtualHost内部使用 ErrorDocument 404 /notfound.php 当服务器响应为404的时候会自动跳转到notfound.php
为了适应多种浏览器的不同 /notfound.php最好使用绝对的HTTP开头,如:http://blog.daxi8.cn/notfound.php
可以使用 .htaccess文件关闭 RewriteEngine Off 来关闭在此目录的rewrite模块
