Skip to content

Commit

Permalink
lighttpd: prefer 308 to 301 for HTTP redirection
Browse files Browse the repository at this point in the history
x-ref:
  "308 Permanent Redirect"
  mozilla#117
  "For Apache, prefer 308 Permanent Redirect to 301 Moved Permanently"
  mozilla#137
  • Loading branch information
gstrauss committed Mar 14, 2024
1 parent 6893e28 commit 1650e3c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/templates/partials/lighttpd.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ $HTTP["scheme"] == "https" {
)
}
else $HTTP["scheme"] == "http" {
{{#unless (includes "old" form.config)}}
{{#unless (minver "1.4.75" form.serverVersion)}}
{{#if (minver "1.4.31" form.serverVersion)}}
url.redirect-code = 308
{{/if}}
{{/unless}}
{{/unless}}
{{#if (minver "1.4.50" form.serverVersion)}}
url.redirect = ("" => "https://${url.authority}${url.path}${qsa}")
{{else}}
Expand Down

0 comments on commit 1650e3c

Please sign in to comment.