lighttpd 1.4.x 版本下 php程序404返回错误的状态码200的解决方案.
这是lighttpd 1.4.x 的bug
在每个项目的根目录下加一个error.php文件
文件中将状态码改为404
<?php
header(‘Status: 404 Not found’);
?>
每次lighttpd访问不存在的文件时 将交由 error.php 处理
(在lighttpd中设置 server.error-handler-404 = “/error.php”
)
这是lighttpd 1.4.x 的bug
在每个项目的根目录下加一个error.php文件
文件中将状态码改为404
<?php
header(‘Status: 404 Not found’);
?>
每次lighttpd访问不存在的文件时 将交由 error.php 处理
(在lighttpd中设置 server.error-handler-404 = “/error.php”
)
没有评论▼