diff --git a/salt/docs/config/nginx.docs-redirects.conf b/salt/docs/config/nginx.docs-redirects.conf index 8ed81eaa..d51358ae 100644 --- a/salt/docs/config/nginx.docs-redirects.conf +++ b/salt/docs/config/nginx.docs-redirects.conf @@ -7,8 +7,8 @@ location = / { return 302 $scheme://$host/3/; } -# Python 3 docs are the default at the root of each translations. -location ~ ^/(es|fr|id|it|ja|ko|pl|pt-br|tr|uk|zh-cn|zh-tw)/$ { +# Python 3 docs are the default at the root of each translation. +location ~ ^/(bn-in|el|es|fr|id|it|ja|ko|pl|pt-br|ro|tr|uk|zh-cn|zh-tw)/$ { return 302 $scheme://$host/$1/3/; } @@ -190,7 +190,7 @@ location ~ ^/((2|3)(\.[0-9]+)?|dev)/\w+/[\d\w\.]+(?!\.html)$ { location ~ ^/((2|3)(\.[0-9]+)?|dev)/ { add_header Surrogate-Key en/$1 always; } -location ~ ^/(es|fr|id|it|ja|ko|pl|pt-br|tr|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|dev)/ { +location ~ ^/(bn-in|el|es|fr|id|it|ja|ko|pl|pt-br|ro|tr|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|dev)/ { add_header Surrogate-Key $1/$2 always; } diff --git a/tests/docs-redirects/specs/PEP-594.hurl b/tests/docs-redirects/specs/PEP-594.hurl index 77c62ac3..5b5168eb 100644 --- a/tests/docs-redirects/specs/PEP-594.hurl +++ b/tests/docs-redirects/specs/PEP-594.hurl @@ -18,6 +18,36 @@ HTTP 301 [Asserts] header "Location" == "https://localhost/3.14/" +GET {{host}}/bn-in/3/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/bn-in/3/" + +GET {{host}}/bn-in/3.13/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/bn-in/3.13/" + +GET {{host}}/bn-in/3.14/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/bn-in/3.14/" + +GET {{host}}/el/3/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/el/3/" + +GET {{host}}/el/3.13/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/el/3.13/" + +GET {{host}}/el/3.14/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/el/3.14/" + GET {{host}}/es/3/library/2to3.html HTTP 301 [Asserts] @@ -138,6 +168,21 @@ HTTP 301 [Asserts] header "Location" == "https://localhost/pt-br/3.14/" +GET {{host}}/ro/3/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/ro/3/" + +GET {{host}}/ro/3.13/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/ro/3.13/" + +GET {{host}}/ro/3.14/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/ro/3.14/" + GET {{host}}/tr/3/library/2to3.html HTTP 301 [Asserts] @@ -215,6 +260,36 @@ HTTP 301 [Asserts] header "Location" == "https://localhost/3.14/" +GET {{host}}/bn-in/3/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/bn-in/3/" + +GET {{host}}/bn-in/3.13/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/bn-in/3.13/" + +GET {{host}}/bn-in/3.14/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/bn-in/3.14/" + +GET {{host}}/el/3/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/el/3/" + +GET {{host}}/el/3.13/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/el/3.13/" + +GET {{host}}/el/3.14/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/el/3.14/" + GET {{host}}/es/3/library/tkinter.tix.html HTTP 301 [Asserts] @@ -335,6 +410,21 @@ HTTP 301 [Asserts] header "Location" == "https://localhost/pt-br/3.14/" +GET {{host}}/ro/3/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/ro/3/" + +GET {{host}}/ro/3.13/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/ro/3.13/" + +GET {{host}}/ro/3.14/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/ro/3.14/" + GET {{host}}/tr/3/library/tkinter.tix.html HTTP 301 [Asserts] diff --git a/tests/docs-redirects/specs/default-root.hurl b/tests/docs-redirects/specs/default-root.hurl index d8ad0d6b..4ba8ed5a 100644 --- a/tests/docs-redirects/specs/default-root.hurl +++ b/tests/docs-redirects/specs/default-root.hurl @@ -8,6 +8,16 @@ header "Location" == "http://localhost/3/" # Assert that Python 3 is the default at the root of each translation. +GET {{host}}/bn-in/ +HTTP 302 +[Asserts] +header "Location" == "http://localhost/bn-in/3/" + +GET {{host}}/el/ +HTTP 302 +[Asserts] +header "Location" == "http://localhost/el/3/" + GET {{host}}/es/ HTTP 302 [Asserts] @@ -48,6 +58,11 @@ HTTP 302 [Asserts] header "Location" == "http://localhost/pt-br/3/" +GET {{host}}/ro/ +HTTP 302 +[Asserts] +header "Location" == "http://localhost/ro/3/" + GET {{host}}/tr/ HTTP 302 [Asserts] diff --git a/tests/docs-redirects/specs/surrogate-key.hurl b/tests/docs-redirects/specs/surrogate-key.hurl index 2408a65b..7e0f1336 100644 --- a/tests/docs-redirects/specs/surrogate-key.hurl +++ b/tests/docs-redirects/specs/surrogate-key.hurl @@ -295,6 +295,66 @@ header "Surrogate-Key" == "en/3.14" ## Languages +GET {{host}}/bn-in/3/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "bn-in/3" + +GET {{host}}/bn-in/3/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "bn-in/3" + +GET {{host}}/bn-in/3.14/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "bn-in/3.14" + +GET {{host}}/bn-in/3.14/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "bn-in/3.14" + +GET {{host}}/bn-in/dev/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "bn-in/dev" + +GET {{host}}/bn-in/dev/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "bn-in/dev" + +GET {{host}}/el/3/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "el/3" + +GET {{host}}/el/3/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "el/3" + +GET {{host}}/el/3.14/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "el/3.14" + +GET {{host}}/el/3.14/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "el/3.14" + +GET {{host}}/el/dev/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "el/dev" + +GET {{host}}/el/dev/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "el/dev" + GET {{host}}/es/3/ HTTP 404 [Asserts] @@ -535,6 +595,36 @@ HTTP 404 [Asserts] header "Surrogate-Key" == "pt-br/dev" +GET {{host}}/ro/3/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "ro/3" + +GET {{host}}/ro/3/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "ro/3" + +GET {{host}}/ro/3.14/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "ro/3.14" + +GET {{host}}/ro/3.14/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "ro/3.14" + +GET {{host}}/ro/dev/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "ro/dev" + +GET {{host}}/ro/dev/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "ro/dev" + GET {{host}}/tr/3/ HTTP 404 [Asserts]