lighttpd forum lighty > Secure folders

Posted by Dobes Vandermeer (Guest)
on 10.07.2008 00:14
I'd like to be able to set my lighttpd so that some URLs are 
automatically redirected to SSL.  I've this tried configuration:

$HTTP["url"] =~ "^/cmsmsx(?:/.*)?$" {
    $HTTP["scheme"] == "http" {
        url.redirect = ("^/(.*)" => 
"https://staging.habitsoft.com:4031/$1")
    } else $HTTP["scheme"] == "https" {

        index-file.names = ("index.php",
                            "index.html")
        fastcgi.server = (".php" => (( ... )))
    }

}

Using lighttpd-1.4.19 (ssl).  When I try to access the http:// URL - no 
redirect!  Just a forbidden or not found is returned, which I interpret 
to mean that the url.redirect is being completely ignored.

Is this an issue with the order in which lighttpd performs redirects and 
handles conditions?  Does anyone have a clever workaround?

Thanks!