diff --git a/salt/docs/config/nginx.docs-redirects.conf b/salt/docs/config/nginx.docs-redirects.conf index 15cf2c80..43ae6dae 100644 --- a/salt/docs/config/nginx.docs-redirects.conf +++ b/salt/docs/config/nginx.docs-redirects.conf @@ -8,7 +8,7 @@ location = / { } # Python 3 docs are the default at the root of each translation. -location ~ ^/(bn-in|de|el|es|fr|id|it|ja|ko|pl|pt-br|ro|ru|sv|tr|uk|zh-cn|zh-tw)/$ { +location ~ ^/(bn-in|de|el|es|fa|fr|id|it|ja|ko|pl|pt-br|ro|ru|sv|tr|uk|zh-cn|zh-tw)/$ { return 302 $scheme://$host/$1/3/; } @@ -195,7 +195,7 @@ location ~ ^/((2|3)(\.[0-9]+)?|dev)/ { error_page 404 /$1/404.html; add_header Surrogate-Key en/$1 always; } -location ~ ^/(bn-in|de|el|es|fr|id|it|ja|ko|pl|pt-br|ro|ru|tr|sv|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|dev)/ { +location ~ ^/(bn-in|de|el|es|fa|fr|id|it|ja|ko|pl|pt-br|ro|ru|tr|sv|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|dev)/ { error_page 404 /$1/$2/404.html; 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 0613626c..d6c01c29 100644 --- a/tests/docs-redirects/specs/PEP-594.hurl +++ b/tests/docs-redirects/specs/PEP-594.hurl @@ -63,6 +63,21 @@ HTTP 301 [Asserts] header "Location" == "https://localhost/es/3.14/" +GET {{host}}/fa/3/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/fa/3/" + +GET {{host}}/fa/3.13/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/fa/3.13/" + +GET {{host}}/fa/3.14/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/fa/3.14/" + GET {{host}}/fr/3/library/2to3.html HTTP 301 [Asserts] @@ -335,6 +350,21 @@ HTTP 301 [Asserts] header "Location" == "https://localhost/es/3.14/" +GET {{host}}/fa/3/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/fa/3/" + +GET {{host}}/fa/3.13/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/fa/3.13/" + +GET {{host}}/fa/3.14/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/fa/3.14/" + GET {{host}}/fr/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 90c091bc..8c809191 100644 --- a/tests/docs-redirects/specs/default-root.hurl +++ b/tests/docs-redirects/specs/default-root.hurl @@ -23,6 +23,11 @@ HTTP 302 [Asserts] header "Location" == "http://localhost/es/3/" +GET {{host}}/fa/ +HTTP 302 +[Asserts] +header "Location" == "http://localhost/fa/3/" + GET {{host}}/fr/ HTTP 302 [Asserts] diff --git a/tests/docs-redirects/specs/surrogate-key.hurl b/tests/docs-redirects/specs/surrogate-key.hurl index 3a4374c6..3da2c77b 100644 --- a/tests/docs-redirects/specs/surrogate-key.hurl +++ b/tests/docs-redirects/specs/surrogate-key.hurl @@ -385,6 +385,36 @@ HTTP 404 [Asserts] header "Surrogate-Key" == "es/dev" +GET {{host}}/fa/3/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "fa/3" + +GET {{host}}/fa/3/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "fa/3" + +GET {{host}}/fa/3.14/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "fa/3.14" + +GET {{host}}/fa/3.14/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "fa/3.14" + +GET {{host}}/fa/dev/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "fa/dev" + +GET {{host}}/fa/dev/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "fa/dev" + GET {{host}}/fr/3/ HTTP 404 [Asserts]