title: lighttpd url.rewrite-once += (...) erasing earlier rules?
body: <p>In my lighttpd.conf:</p>
  
  <pre><code>$HTTP["host"] =~ "^(www\.|foo\.|bar\.)?domain\.com$" {
      url.rewrite-once += (
          "^/favicon.ico$"        =&gt; "/images/favicon_cd.ico",
          "^/course/?$"           =&gt; "/course/index.php",
          "^/course/([^./]+)$"    =&gt; "/course/index.php?w=$1"
      )   
  }
  ...
  # don't allow spiders to crawl subdomains
  $HTTP["host"] =~ "^(foo\.|bar\.)?domain\.com$" {
     url.rewrite-once += (
         "^/robots.txt$"          =&gt; "/robots_nocrawl.txt"
     )
  }
  </code></pre>
  
  <p>We have <code>www.domain.com</code> as well as <code>foo.domain.com</code> and <code>bar.domain.com</code> for specific clients. And plain <code>domain.com</code> should work too.</p>
  
  <p>The first set of rewrite rules send <code>.../course/x</code> to <code>.../course/index.php?w=x</code>. Those work for <code>domain.com</code> and <code>www.domain.com</code>, but for <code>foo.domain.com</code> and <code>bar.domain.com</code> the rewrite doesn't work. I can see the rewrite is not happening by turning on lighttpd's debug logging.</p>
  
  <p>If I disable the second block of <code>rewrite-once</code> rules that just try to prevent robots crawling <code>foo.domain.com</code> and <code>bar.domain.com</code> the first set of rewrites will work for all subdomains.</p>
  
  <p>I am pretty sure <code>url.rewrite-once += (...)</code> works because I have an earlier set of global rewrite-once rules that are applied.</p>
  
  <p>Any idea why the last set of rewrite-once rules that are only supposed to be applied to foo and bar subdomains would prevent the earlier rules working?</p>