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

What the title says.. is defined in lighttpd.conf as a virtual host:

$HTTP["host"] =~ "(^|\.)$" {
        server.document-root = "/usr/www/"
        accesslog.filename = "/var/log/www/"
        $HTTP["url"] =~ ".pl$" {
                cgi.assign = (".pl" => "/usr/bin/perl" )

However, instead of going by the files listed in index-file.names (the usual index.html, default.html, etc), i want all requests to the root of the virtual host to be forwarded to /cgi-bin/ What's the easiest/best way of doing this? This need is a special case, and will only apply to this virtualhost. Is it possible to have that particular virtualhost send a redirect in the header?

share|improve this question
up vote 1 down vote accepted

If you want to send an HTTP redirect:

url.redirect = ( "^/$" => "/cgi-bin/" )

If you want an internal rewrite:

url.rewrite = ( "^/$" => "/cgi-bin/" )
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.