Making lighttpd redirect from www.exampe.com to www.example.com/cgi-bin/index.pl

Posted by jarmund on Server Fault See other posts from Server Fault or by jarmund
Published on 2012-07-03T21:02:23Z Indexed on 2012/07/03 21:17 UTC
Read the original article Hit count: 318

Filed under:
|
|
|
|

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?

© Server Fault or respective owner

Related posts about virtualhost

Related posts about redirect