Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

To me this seem logical, but it doesn't seem to work.

$HTTP["host"] =~ "(^|\.)hd.domain\.com$" {
    server.document-root = "/domain_site/"

    $HTTP["url"] =~ "^/aa/" {
      server.document-root = "/domain_aa_site/"


When I go to I get "404 - Not Found"

What am I doing wrong?

share|improve this question
what are you trying to achieve? Why don't you just put an "aa" subolfer inside "/domain_site/" ? – Niko S P Feb 23 '12 at 0:02
I want to link to several different folders, some on other hard drives, I have created a few different sub domains, but it would be much easier to just add fake folders as above... – Syntax Feb 23 '12 at 1:13
up vote 5 down vote accepted

You're looking for lighttpd's mod_alias.

Something like this:

alias.url = (
  "/aa" => "/domain_aa_site/"
  "/somewhere/else" => "/other/docroot/"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.