Ticket #1270 (closed defect: fixed)
error-handler-404 cannot change status code (introduced by 1.4.16)
| Reported by: | pierre | Owned by: | darix |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.4.17 |
| Component: | core | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | rtomayko@… | Blocked By: | |
| Need User Feedback: | no | Blocking: |
Description
Since lighttpd 1.4.16 an error-handler cannot change the 404 status code any more. This is needed if your handler wants to redirect to another site for example.
Think of a 404-handler which does the following:
<?php
header('HTTP/1.1 302 Found'); // shouldn`t be needed
header('Location: http://www.lighttpd.net');
exit();
?>
Using this script as an error-handler-404 lighttpd outputs the following when trying to access a nonexistent file:
HTTP/1.1 404 Not Found Location: http://www.lighttpd.net Content-type: text/html Content-Length: 0 Date: Fri, 27 Jul 2007 18:36:10 GMT Server: lighttpd/1.4.16
So it does not override the 404 status code. Browsers will ignore the Location when no 302 status code was sent.
This worked with version 1.4.15.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

