Lighttpd – redirect everything to https

httpslighttpdredirect

I have tried to use the example from this wiki page

$HTTP["scheme"] == "http" {
    # capture vhost name with regex conditiona -> %0 in redirect pattern
    # must be the most inner block to the redirect rule
    $HTTP["host"] =~ ".*" {
        url.redirect = (".*" => "https://%0$0")
    }
}

But when I enter this url –

http://www.domain.co.il/index.php?shop=amazon

I got redirected to

https://index.php/index.php?shop=amazon

What is the problem?

Best Answer

Everything works fine after removing this -

url.rewrite-once = ( "^/min/([a-z]=.*)" => "/min/index.php?$1",
        "^(.*)\.(jpg|gif|woff|tff|png|js|css|html|htm|txt)(.*)$" => "$0",
        "^/question2answer/(.+)$" => "/question2answer/index.php?qa-rewrite=$1",
       "^/$" => "/index.php"
     )
Related Topic