title: Lighttpd mod_accesslog cannot display Request_URI with custom error pages
body: <p>I need some help to customize my access log on Lighttpd 1.4.28. So far I have been able to modify the configuration to display the date in a <a href="http://linux.die.net/man/3/strftime" rel="nofollow">strftime(3)</a> format. The default date format is just way too long. Here are the relevant lines from <code>/etc/lighttpd/lighttpd.conf</code></p>
  
  <pre><code>accesslog.format = "%s [%{%d%b-%H:%M}t] %h      %b %U   *       %{From}i|%{Via}i|%{Referer}i    *
  accesslog.filename = "/web/lighttpd_access.log"
  </code></pre>
  
  <p>And here is my access.log entry:</p>
  
  <pre><code>404 [24Aug-16:55] 98.68.178.112 345 /phpMyAdmin/scripts/setup.php   *   -|-|-   *   "Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 Safari/535.1"
  </code></pre>
  
  <p>Customizing the date was not hard, but I ran into a problem trying to display request URL while simultaneously using custom  404 pages. I just added </p>
  
  <pre><code>server.error-handler-404 = "/error.html"
  </code></pre>
  
  <p>to the <code>lighttpd.conf</code> file, and the <code>lighttpd_access.log</code> now contains redirected <code>/error.html</code>, instead of the full url of the request that generated the error.</p>
  
  <pre><code>200 [24Aug-16:06] 98.68.178.112 1 /error.html   *   -|-|-   *   "Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 Safari/535.1"
  </code></pre>
  
  <p>I have also tried adding <code>%{Request_URI}i</code>, but the log entry was <code>-</code> blank. Anyone knows the correct syntax to use when trying to display the original request URL in conjunction with custom 404 pages?</p>