Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

What the title says..

www.example.com is defined in lighttpd.conf as a virtual host:

$HTTP["host"] =~ "(^|\.)example.com$" {
        server.document-root = "/usr/www/example.com/http"
        accesslog.filename = "/var/log/www/example.com/access.log"
        $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/index.pl. 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

1 Answer 1

up vote 1 down vote accepted

If you want to send an HTTP redirect:

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

If you want an internal rewrite:

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