Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a few d.p.o redirect rules #506

Merged
merged 8 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions salt/docs/config/nginx.docs-redirects.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ location ~ \.(pdf|zip|epub|bz2)$ {
}

# Some doc download pages link to docs.python.org/ftp instead of www.python.org/ftp.
location ^~ /ftp/ {
location ^~ /ftp/python/doc {
return 301 https://www.python.org$request_uri;
}

location ~ /py3k(.*)$ {
# Py3k is Python 3
location ~ ^/py3k(.*)$ {
return 301 https://$host/3$1;
}

Expand Down Expand Up @@ -169,7 +170,7 @@ location = /documenting/building.html {
location ~ ^/((archives|c-api|distutils|extending|faq|howto|install|library|reference|tutorial|using|whatsnew|_images|_sources|_static)(/.*)?)$ {
return 301 https://$host/3/$1;
}
location ~ ^/(about|bugs|contents|copyright|download|genindex.*|glossary|index|license|py-modindex|search)(.html)?$ {
location ~ ^/(about|bugs|contents|copyright|download|genindex(-[^.]+)?|glossary|index|license|py-modindex|search)(.html)?$ {
return 301 https://$host/3/$1.html;
}
location ~ ^/(searchindex.js|objects.inv)$ {
Expand Down
8 changes: 4 additions & 4 deletions tests/docs-redirects/specs/top-level-files.hurl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ header "Location" == "https://localhost/3/download.html"
GET {{host}}/genindex.html
HTTP 301
[Asserts]
header "Location" == "https://localhost/3/genindex.html.html"
header "Location" == "https://localhost/3/genindex.html"

GET {{host}}/genindex
HTTP 301
Expand All @@ -63,7 +63,7 @@ header "Location" == "https://localhost/3/genindex.html"
GET {{host}}/genindex-_.html
HTTP 301
[Asserts]
header "Location" == "https://localhost/3/genindex-_.html.html"
header "Location" == "https://localhost/3/genindex-_.html"

GET {{host}}/genindex-_
HTTP 301
Expand All @@ -73,7 +73,7 @@ header "Location" == "https://localhost/3/genindex-_.html"
GET {{host}}/genindex-A.html
HTTP 301
[Asserts]
header "Location" == "https://localhost/3/genindex-A.html.html"
header "Location" == "https://localhost/3/genindex-A.html"

GET {{host}}/genindex-A
HTTP 301
Expand All @@ -83,7 +83,7 @@ header "Location" == "https://localhost/3/genindex-A.html"
GET {{host}}/genindex-Symbols.html
HTTP 301
[Asserts]
header "Location" == "https://localhost/3/genindex-Symbols.html.html"
header "Location" == "https://localhost/3/genindex-Symbols.html"

GET {{host}}/genindex-Symbols
HTTP 301
Expand Down
Loading