Skip to content

Commit

Permalink
Revert "Redirect full version archive files to {major}.{minor}" (#…
Browse files Browse the repository at this point in the history
…519)

Revert "Redirect full version archive files to ``{major}.{minor}`` (#498)"

This reverts commit 355ffe5.
  • Loading branch information
ewdurbin authored Oct 11, 2024
1 parent 355ffe5 commit 4a8770d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6,095 deletions.
15 changes: 5 additions & 10 deletions salt/docs/config/nginx.docs-redirects.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ location ~ ^/(es|fr|id|it|ja|ko|pl|pt-br|tr|uk|zh-cn|zh-tw)/$ {
return 302 $scheme://$host/$1/3/;
}

# Pretty 404 for archives telling to wait for them to be built.
location ~ \.(pdf|zip|epub|bz2)$ {
error_page 404 /404.html;
}

# Some doc download pages link to docs.python.org/ftp instead of www.python.org/ftp.
location ^~ /ftp/python/doc {
return 301 https://www.python.org$request_uri;
Expand Down Expand Up @@ -192,11 +197,6 @@ location ~ ^/(es|fr|id|it|ja|ko|pl|pt-br|tr|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|de
add_header Surrogate-Key $1/$2 always;
}

# Map archive URLs to {major}.{minor}
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)$ {
return 301 https://$host/$1$2/archives/python-$3-docs$6;
}

# Map old, 2.5-and-earlier directory names to 2.6-and-later names.
location = /lib/ {
return 301 https://$host/3/library/;
Expand Down Expand Up @@ -228,8 +228,3 @@ location = /doc/ {
location = /ref/ {
return 301 https://$host/3/reference/;
}

# Pretty 404 for archives telling to wait for them to be built.
location ~ \.(pdf|zip|epub|bz2)$ {
error_page 404 /404.html;
}
Loading

0 comments on commit 4a8770d

Please sign in to comment.