Skip to content

Commit 977b72b

Browse files
authored
docs: add redirects for removed landing pages (#2213)
1 parent 0d324e1 commit 977b72b

2 files changed

Lines changed: 6 additions & 16 deletions

File tree

.github/workflows/test.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,44 +89,34 @@ jobs:
8989
assert_header "http://localhost:8080/llms-full.txt" "Content-Type" "text/markdown"
9090
9191
echo "🧪 Checking Nginx responses... (apify-sdk-js)"
92-
assert_header "http://localhost:8080/sdk/js" "Content-Type" "text/html"
93-
assert_header "http://localhost:8080/sdk/js" "Content-Type" "text/markdown" -H "Accept: text/markdown"
9492
assert_header "http://localhost:8080/sdk/js/docs/guides/apify-platform" "Content-Type" "text/html"
9593
assert_header "http://localhost:8080/sdk/js/docs/guides/apify-platform.md" "Content-Type" "text/markdown"
9694
assert_header "http://localhost:8080/sdk/js/docs/guides/apify-platform" "Content-Type" "text/markdown" -H "Accept: text/markdown"
9795
assert_header "http://localhost:8080/sdk/js/llms.txt" "Content-Type" "text/markdown"
9896
assert_header "http://localhost:8080/sdk/js/llms-full.txt" "Content-Type" "text/markdown"
9997
10098
echo "🧪 Checking Nginx responses... (apify-sdk-python)"
101-
assert_header "http://localhost:8080/sdk/python" "Content-Type" "text/html"
102-
assert_header "http://localhost:8080/sdk/python" "Content-Type" "text/markdown" -H "Accept: text/markdown"
10399
assert_header "http://localhost:8080/sdk/python/docs/changelog" "Content-Type" "text/html"
104100
assert_header "http://localhost:8080/sdk/python/docs/changelog.md" "Content-Type" "text/markdown"
105101
assert_header "http://localhost:8080/sdk/python/docs/changelog" "Content-Type" "text/markdown" -H "Accept: text/markdown"
106102
assert_header "http://localhost:8080/sdk/python/llms.txt" "Content-Type" "text/markdown"
107103
assert_header "http://localhost:8080/sdk/python/llms-full.txt" "Content-Type" "text/markdown"
108104
109105
echo "🧪 Checking Nginx responses... (apify-client-js)"
110-
assert_header "http://localhost:8080/api/client/js" "Content-Type" "text/html"
111-
assert_header "http://localhost:8080/api/client/js" "Content-Type" "text/markdown" -H "Accept: text/markdown"
112106
assert_header "http://localhost:8080/api/client/js/docs/changelog" "Content-Type" "text/html"
113107
assert_header "http://localhost:8080/api/client/js/docs/changelog.md" "Content-Type" "text/markdown"
114108
assert_header "http://localhost:8080/api/client/js/docs/changelog" "Content-Type" "text/markdown" -H "Accept: text/markdown"
115109
assert_header "http://localhost:8080/api/client/js/llms.txt" "Content-Type" "text/markdown"
116110
assert_header "http://localhost:8080/api/client/js/llms-full.txt" "Content-Type" "text/markdown"
117111
118112
echo "🧪 Checking Nginx responses... (apify-client-python)"
119-
assert_header "http://localhost:8080/api/client/python" "Content-Type" "text/html"
120-
assert_header "http://localhost:8080/api/client/python" "Content-Type" "text/markdown" -H "Accept: text/markdown"
121113
assert_header "http://localhost:8080/api/client/python/docs/changelog" "Content-Type" "text/html"
122114
assert_header "http://localhost:8080/api/client/python/docs/changelog.md" "Content-Type" "text/markdown"
123115
assert_header "http://localhost:8080/api/client/python/docs/changelog" "Content-Type" "text/markdown" -H "Accept: text/markdown"
124116
assert_header "http://localhost:8080/api/client/python/llms.txt" "Content-Type" "text/markdown"
125117
assert_header "http://localhost:8080/api/client/python/llms-full.txt" "Content-Type" "text/markdown"
126118
127119
echo "🧪 Checking Nginx responses... (apify-cli)"
128-
assert_header "http://localhost:8080/cli" "Content-Type" "text/html"
129-
assert_header "http://localhost:8080/cli" "Content-Type" "text/markdown" -H "Accept: text/markdown"
130120
assert_header "http://localhost:8080/cli/docs/changelog" "Content-Type" "text/html"
131121
assert_header "http://localhost:8080/cli/docs/changelog.md" "Content-Type" "text/markdown"
132122
assert_header "http://localhost:8080/cli/docs/changelog" "Content-Type" "text/markdown" -H "Accept: text/markdown"

nginx.conf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -459,12 +459,12 @@ server {
459459
rewrite ^/apify-client-js/latest/?$ /api/client/js redirect;
460460
rewrite ^/apify-client-python/?$ /api/client/python redirect;
461461

462-
# remove trailing slashes from the root of GH pages docs
463-
rewrite ^/api/client/js/$ /api/client/js redirect;
464-
rewrite ^/api/client/python/$ /api/client/python redirect;
465-
rewrite ^/sdk/js/$ /sdk/js redirect;
466-
rewrite ^/sdk/python/$ /sdk/python redirect;
467-
rewrite ^/cli/$ /cli redirect;
462+
# Landing page removal redirects - redirect root paths to docs pages
463+
rewrite ^/api/client/js/?$ /api/client/js/docs permanent;
464+
rewrite ^/api/client/python/?$ /api/client/python/docs/overview permanent;
465+
rewrite ^/sdk/js/?$ /sdk/js/docs/overview permanent;
466+
rewrite ^/sdk/python/?$ /sdk/python/docs/overview permanent;
467+
rewrite ^/cli/?$ /cli/docs permanent;
468468

469469
# versions page redirects
470470
rewrite ^/versions/?$ / permanent; # no docs-wide changelog, redirect to the root

0 commit comments

Comments
 (0)