我使用真棒前端优化器fasterize.com ,这需要www子域。 另外我有一个付款页面,我会使用HTTPS而不使用快速,所以在另一个子域。
我使用lighttpd,我已经有了一个很好的redirect所有页面。 我为付款页面添加了子域名和规则,如下所示:
$HTTP["host"] =~ "^payment\.domain\.com$" { url.redirect = ("^/(.*)$" => "https://domain.com/payment/") } $HTTP["host"] =~ "^domain\.com$" { url.redirect = ("^/(.*)$" => "http://www.domain.com/$1") }
但第二个规则赶上第一个的呼吁,我得到http://www.domain.com/paymentpage/这是不好的,因为缺lessHTTPS。
是否有任何理由,你不只是使所有的一切https? 根据您在付款页面上加载的资源,如果其中任何资源不安全(http),您将在控制台中收到警告,或者根本没有加载资源。
$HTTP["host"] =~ "^payment\.domain\.com$" { # Redirect to the fully correct domain - www.domain.com - to avoid more redirects url.redirect = ("^/(.*)$" => "https://www.domain.com/payment/") } # Redirect any http requests for the payment domain $HTTP["scheme"] == "http" { url.redirect = ( "^/payment/$" => "https://www.domain.com/payment/" ) } $HTTP["host"] =~ "^domain\.com$" { url.redirect = ("^/(.*)$" => "http://www.domain.com/$1") }
为了澄清,无法添加评论,Fasterize支持SSL: http : //www.fasterize.com/en/faq只需要求支持团队将您的证书安装在Fasterize基础架构上即可。
– stephane(CEO,Fasterize 😉