eximconf: re-order checks to avoid unnecessary DNS lookups
[mirror/dsa-puppet.git] / modules / roles / templates / apache-www.debian.org.erb
index 45eab88..9222a51 100644 (file)
    # The GDPR does not apply and to satisfy the EU cookie law we can include
    # some explanatory text around the form that sets the cookie.
    # The use of POST requests will ensure each cookie is only set explictly.
+   # When a cookie is set by the user, update it on every visit so it doesn't
+   # expire unless the user stops visiting the website for the cookie duration.
    # Since Apache mod_rewrite cannot inspect POST data, we use URLs instead.
    RewriteEngine on
    RewriteCond %{REQUEST_METHOD} ^POST$
    RewriteRule /intro/cn/setlang/([a-z]{2}(?:-[a-z]{2})?)/(.*) /$2 [last,redirect,cookie=lang:$1:%{HTTP_HOST}:40320:/:secure:]
    RewriteCond %{REQUEST_METHOD} ^POST$
-   RewriteRule /intro/cn/unsetlang/(.*) /$2 [last,redirect,cookie=lang:invalid:%{HTTP_HOST}:-1:/:secure:]
+   RewriteRule /intro/cn/unsetlang/(.*) /$1 [last,redirect,cookie=lang:invalid:%{HTTP_HOST}:-1:/:secure:]
+   RewriteCond %{HTTP_COOKIE} /^lang=([a-z]{2}(?:-[a-z]{2})?)$/
+   RewriteRule . - [cookie=lang:%1:%{HTTP_HOST}:40320:/:secure:]
    SetEnvIf Cookie "lang=(.+)" prefer-language=$1
    Header append Vary cookie
 
    RewriteRule ^/doc/manuals/debian-reference/footnotes(.+)   /doc/manuals/debian-reference/index$1 [L,R]
    RewriteRule ^/doc/manuals/debian-reference/footnotes$      /doc/manuals/debian-reference/          [R]
 
-# DevRef filename changes c2016
-   RedirectMatch ^(/doc/manuals/developers-reference)/scope(\.[a-z]{2})?.html                 $1/ch01$2.html
-   RedirectMatch ^(/doc/manuals/developers-reference)/new-maintainer(\.[a-z]{2})?.html        $1/ch02$2.html
-   RedirectMatch ^(/doc/manuals/developers-reference)/developer-duties(\.[a-z]{2})?.html      $1/ch03$2.html
-   RedirectMatch ^(/doc/manuals/developers-reference)/resources(\.[a-z]{2})?.html             $1/ch04$2.html
-   RedirectMatch ^(/doc/manuals/developers-reference)/pkgs(\.[a-z]{2})?.html                  $1/ch05$2.html
-   RedirectMatch ^(/doc/manuals/developers-reference)/best-pkging-practices(\.[a-z]{2})?.html $1/ch06$2.html
-   RedirectMatch ^(/doc/manuals/developers-reference)/beyond-pkging(\.[a-z]{2})?.html         $1/ch07$2.html
-   RedirectMatch ^(/doc/manuals/developers-reference)/l10n(\.[a-z]{2})?.html                  $1/ch08$2.html
-   RedirectMatch ^(/doc/manuals/developers-reference)/tools(\.[a-z]{2})?.html                 $1/apa$2.html
+# DevRef filename changes c2019 (#931548, migration to Sphinx)
+   RedirectMatch ^(/doc/manuals/developers-reference)/ch01(\.[a-z]{2})?.html $1/scope$2.html
+   RedirectMatch ^(/doc/manuals/developers-reference)/ch02(\.[a-z]{2})?.html $1/new-maintainer$2.html
+   RedirectMatch ^(/doc/manuals/developers-reference)/ch03(\.[a-z]{2})?.html $1/developer-duties$2.html
+   RedirectMatch ^(/doc/manuals/developers-reference)/ch04(\.[a-z]{2})?.html $1/resources$2.html
+   RedirectMatch ^(/doc/manuals/developers-reference)/ch05(\.[a-z]{2})?.html $1/pkgs$2.html
+   RedirectMatch ^(/doc/manuals/developers-reference)/ch06(\.[a-z]{2})?.html $1/best-pkging-practices$2.html
+   RedirectMatch ^(/doc/manuals/developers-reference)/ch07(\.[a-z]{2})?.html $1/beyond-pkging$2.html
+   RedirectMatch ^(/doc/manuals/developers-reference)/ch08(\.[a-z]{2})?.html $1/l10n$2.html
+   RedirectMatch ^(/doc/manuals/developers-reference)/apa(\.[a-z]{2})?.html  $1/tools$2.html
 
 # New Maintainers' Guide
    RewriteRule ^/doc/(manuals/)?maint-guide/ch-(.*) /doc/manuals/maint-guide/$2 [R]