title: Lighttpd rewrite-if-not-file cannot process *php and *html in one rule
body: <p>To enable a shorten-url service, I had to add a rewrite rule to my
  lighttpd.conf. This seems to be important, otherwise shortlinks like
  <a href="http://example.com/Xf6Y" rel="nofollow">http://example.com/Xf6Y</a> would return a 404 error. This is because Xf6Y
  is not a file but a shortlink hash.</p>
  
  <p>So I added these lines to my lighttpd.conf:</p>
  
  <p><pre><code>url.rewrite-if-not-file = (
    "^/(.*)$" => "/index.php?fwd=$1"
  )
  </pre></code></p>
  
  <p>This works excellently, except for websites that contain a index.html
  instead of an index.php.</p>
  
  <p>I tried to duplicate the rewrite rule, like <pre><code>url.rewrite-if-not-file = (
          "^/(.<em>)(\?.</em>)?$" => "/index.php?fwd=$1",
          "^/(.<em>)(\?.</em>)?$" => "/index.html?fwd=$1"
  )
  </pre></code> This resulted in a "duplicate rule" error, so lighttpd is
  not able to restart.</p>
  
  <p>Does anyone know how to write a rewrite rule that will redirect index.php and index.html?</p>