I use the awesome front end optimizer fasterize.com , which requires
www
subdomain. Also I have a payment page that I would use HTTPS without using fasterize, so on another subdomain.
I use lighttpd, I already have a good redirection for all pages. I added subdomain and a rule for the payment page, like this :
$HTTP["host"] =~ "^payment\.domain\.com$" {
url.redirect = ("^/(.*)$" => "https://domain.com/payment/")
}
$HTTP["host"] =~ "^domain\.com$" {
url.redirect = ("^/(.*)$" => "http://www.domain.com/$1")
}
But the second rule catch the call of first one and I get http://www.domain.com/paymentpage/
which is not good because of missing HTTPS.