Skip to content

Commit 98157d5

Browse files
authored
Avoid multiple redirects in pre-2.5 paths (#518)
1 parent 8ca732c commit 98157d5

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

salt/docs/config/nginx.docs-redirects.conf

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,32 +199,32 @@ location ~ ^/(es|fr|id|it|ja|ko|pl|pt-br|tr|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|de
199199

200200
# Map old, 2.5-and-earlier directory names to 2.6-and-later names.
201201
location = /lib/ {
202-
return 301 https://$host/library/;
202+
return 301 https://$host/3/library/;
203203
}
204204
location ~ ^/lib/module-([a-zA-Z0-9.]+)\.html$ {
205-
return 301 https://$host/library/$1.html;
205+
return 301 https://$host/3/library/$1.html;
206206
}
207207
location = /tut/ {
208-
return 301 https://$host/tutorial/;
208+
return 301 https://$host/3/tutorial/;
209209
}
210210
location = /tut/tut.html {
211-
return 301 https://$host/tutorial/;
211+
return 301 https://$host/3/tutorial/;
212212
}
213213
location = /api/ {
214-
return 301 https://$host/c-api/;
214+
return 301 https://$host/3/c-api/;
215215
}
216216
location = /ext/ {
217-
return 301 https://$host/extending/;
217+
return 301 https://$host/3/extending/;
218218
}
219219
location = /dist/ {
220-
return 301 https://docs.python.org/distutils/;
220+
return 301 https://$host/3/;
221221
}
222222
location = /inst/ {
223-
return 301 https://$host/install/;
223+
return 301 https://$host/3/;
224224
}
225225
location = /doc/ {
226-
return 301 https://devguide.python.org/documenting.html;
226+
return 301 https://devguide.python.org/documentation/start-documenting/;
227227
}
228228
location = /ref/ {
229-
return 301 https://$host/reference/;
229+
return 301 https://$host/3/reference/;
230230
}

tests/docs-redirects/specs/py2.5.hurl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,54 @@
44
GET {{host}}/lib/
55
HTTP 301
66
[Asserts]
7-
header "Location" == "https://localhost/library/"
7+
header "Location" == "https://localhost/3/library/"
88

99
GET {{host}}/lib/module-base64.html
1010
HTTP 301
1111
[Asserts]
12-
header "Location" == "https://localhost/library/base64.html"
12+
header "Location" == "https://localhost/3/library/base64.html"
1313

1414
GET {{host}}/lib/module-sys.html
1515
HTTP 301
1616
[Asserts]
17-
header "Location" == "https://localhost/library/sys.html"
17+
header "Location" == "https://localhost/3/library/sys.html"
1818

1919
GET {{host}}/tut/
2020
HTTP 301
2121
[Asserts]
22-
header "Location" == "https://localhost/tutorial/"
22+
header "Location" == "https://localhost/3/tutorial/"
2323

2424
GET {{host}}/tut/tut.html
2525
HTTP 301
2626
[Asserts]
27-
header "Location" == "https://localhost/tutorial/"
27+
header "Location" == "https://localhost/3/tutorial/"
2828

2929
GET {{host}}/api/
3030
HTTP 301
3131
[Asserts]
32-
header "Location" == "https://localhost/c-api/"
32+
header "Location" == "https://localhost/3/c-api/"
3333

3434
GET {{host}}/ext/
3535
HTTP 301
3636
[Asserts]
37-
header "Location" == "https://localhost/extending/"
37+
header "Location" == "https://localhost/3/extending/"
3838

3939
GET {{host}}/dist/
4040
HTTP 301
4141
[Asserts]
42-
header "Location" == "https://docs.python.org/distutils/"
42+
header "Location" == "https://localhost/3/"
4343

4444
GET {{host}}/inst/
4545
HTTP 301
4646
[Asserts]
47-
header "Location" == "https://localhost/install/"
47+
header "Location" == "https://localhost/3/"
4848

4949
GET {{host}}/doc/
5050
HTTP 301
5151
[Asserts]
52-
header "Location" == "https://devguide.python.org/documenting.html"
52+
header "Location" == "https://devguide.python.org/documentation/start-documenting/"
5353

5454
GET {{host}}/ref/
5555
HTTP 301
5656
[Asserts]
57-
header "Location" == "https://localhost/reference/"
57+
header "Location" == "https://localhost/3/reference/"

0 commit comments

Comments
 (0)