File tree Expand file tree Collapse file tree 2 files changed +6095
-5
lines changed
tests/docs-redirects/specs Expand file tree Collapse file tree 2 files changed +6095
-5
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,6 @@ location ~ ^/(es|fr|id|it|ja|ko|pl|pt-br|tr|uk|zh-cn|zh-tw)/$ {
1212 return 302 $scheme://$host/$1/3/;
1313}
1414
15- # Pretty 404 for archives telling to wait for them to be built.
16- location ~ \.(pdf|zip|epub|bz2)$ {
17- error_page 404 /404.html;
18- }
19-
2015# Some doc download pages link to docs.python.org/ftp instead of www.python.org/ftp.
2116location ^~ /ftp/python/doc {
2217 return 301 https://www.python.org$request_uri;
@@ -197,6 +192,11 @@ location ~ ^/(es|fr|id|it|ja|ko|pl|pt-br|tr|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|de
197192 add_header Surrogate-Key $1/$2 always;
198193}
199194
195+ # Map archive URLs to {major}.{minor}
196+ location ~ ^/([a-z-]*/)?(3|3.12|3.13|3.14)/archives/python-(3.12|3.13|3.14)\.\d+((a|b|rc)\d)?-docs(-(html|pdf-a4|pdf-letter|texinfo|text)\.(zip|tar\.bz2)|\.epub)$ {
197+ return 301 https://$host/$1$2/archives/python-$3-docs$6;
198+ }
199+
200200# Map old, 2.5-and-earlier directory names to 2.6-and-later names.
201201location = /lib/ {
202202 return 301 https://$host/3/library/;
@@ -228,3 +228,8 @@ location = /doc/ {
228228location = /ref/ {
229229 return 301 https://$host/3/reference/;
230230}
231+
232+ # Pretty 404 for archives telling to wait for them to be built.
233+ location ~ \.(pdf|zip|epub|bz2)$ {
234+ error_page 404 /404.html;
235+ }
You can’t perform that action at this time.
0 commit comments