Project

General

Profile

Server error-handler-404Details » History » Revision 4

Revision 3 (Anonymous, 2007-09-20 15:16) → Revision 4/10 (jrabbit, 2007-09-20 18:09)

{{{ 
 #!rst 

 server.error-handler-404 option 
 =============================== 

 server.error-handler-404 

     uri to call if the requested URL file results in a static file not being found. It is not invoked if dynamic content, such as a fastcgi script, returns an HTTP 404 status code.  

     404. You can use a dynamic or static page for the handler. 

     The actual status-code sent back to client is 200 if handler uri is successful. If you use want to send a static page, the server will return a 404 HTTP status code with the content of your static page. However, if you please use a server.errorfile-prefix, however server.errorfile-prefix does not allow dynamic page, you must handlers (or use "header" function to set the 404 status code to 404 (or another appropriate if your error code such as "410 Gone") page is in the HTTP headers that your dynamic page generates. 


     PHP). 

     Default: not set 

     Example: :: 

       server.error-handler-404 = "/error-404.php" 


 Prior Versions 
 ============== 

 Versions of lighttpd prior to 1.4.17 contained bugs in the implementation of this directive that meant a 404 status code generated from dynamic content was sent to the error handler. This prevented a 404 status code being sent from the error handler itself, which always returned status 200. If you are using an older version, and want to send a 404 status code please use server.errorfile-prefix; however, server.errorfile-prefix does not allow dynamic handlers. 


 See Also 
 ======== 

  * server.errorfile-prefix option <http://trac.lighttpd.net/trac/wiki/server.errorfile-prefixDetails> 
  * Spice Up Error Page (Blog) <http://blog.lighttpd.net/articles/2005/08/28/spice-up-for-error-page>  
  * HTTP 1.1 Status Codes <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html> 
  

 }}}