From f679fb0a8dd6bbb1b6819612fef186b82f13ff6f Mon Sep 17 00:00:00 2001 From: faraz152 <38698072+faraz152@users.noreply.github.com> Date: Mon, 30 Mar 2026 17:54:17 +0500 Subject: [PATCH] docs: redirect 4.x API doc URLs to 5.x The 4.x API docs were never published to the gh-pages branch, so all /okhttp/4.x/ URLs return 404. Since 5.x is the direct successor with the same package structure (okhttp3), redirect /4.x/ paths to the corresponding /5.x/ path. Both deploy_website.sh and test_docs.sh now generate a 4.x/ redirect page during the docs build. Fixes #9156 --- deploy_website.sh | 23 +++++++++++++++++++++++ test_docs.sh | 23 +++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/deploy_website.sh b/deploy_website.sh index 0e780ea02a8d..548485944915 100755 --- a/deploy_website.sh +++ b/deploy_website.sh @@ -26,6 +26,29 @@ cd $DIR mv ./build/dokka/htmlMultiModule docs/5.x +# Redirect 4.x doc URLs to 5.x. +# The 4.x API docs were never published to gh-pages, so all /4.x/ URLs 404. +# Since 5.x is the direct successor, redirect there. +mkdir -p docs/4.x +cat > docs/4.x/index.html << 'REDIRECT' + + +
+ +OkHttp 4.x API docs are no longer published separately. Redirecting to 5.x API docs.
+ + +REDIRECT + # Copy in special files that GitHub wants in the project root. cat README.md | grep -v 'project website' > docs/index.md cp CHANGELOG.md docs/changelogs/changelog.md diff --git a/test_docs.sh b/test_docs.sh index fdf90a543556..93879bafec2f 100755 --- a/test_docs.sh +++ b/test_docs.sh @@ -16,6 +16,29 @@ set -ex mv ./build/dokka/html docs/5.x +# Redirect 4.x doc URLs to 5.x. +# The 4.x API docs were never published to gh-pages, so all /4.x/ URLs 404. +# Since 5.x is the direct successor, redirect there. +mkdir -p docs/4.x +cat > docs/4.x/index.html << 'REDIRECT' + + + + +OkHttp 4.x API docs are no longer published separately. Redirecting to 5.x API docs.
+ + +REDIRECT + # Copy in special files that GitHub wants in the project root. cat README.md | grep -v 'project website' > docs/index.md cp CHANGELOG.md docs/changelogs/changelog.md