From cf39fa5a91fdd34097ea66bf80df2f2594c08d30 Mon Sep 17 00:00:00 2001 From: Lauren Hirata Singh Date: Fri, 17 Oct 2025 07:27:41 -0400 Subject: [PATCH] fix(docs): fix catchall redirect (#6299) --- docs/_scripts/notebook_hooks.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/_scripts/notebook_hooks.py b/docs/_scripts/notebook_hooks.py index d671edf4e..5617039de 100644 --- a/docs/_scripts/notebook_hooks.py +++ b/docs/_scripts/notebook_hooks.py @@ -870,8 +870,36 @@ def on_post_build(config): with open(root_index_path, "w", encoding="utf-8") as f: f.write(root_redirect_html) + # Create 404.html for GitHub Pages catch-all redirect + # GitHub Pages will serve this for any unmapped URLs + notfound_redirect_html = """ + + + + Redirecting to LangGraph Documentation + + + + + + +

Page Not Found

+

This page has moved to the new LangGraph documentation at docs.langchain.com.

+

Redirecting you now...

+ + +""" + + notfound_path = os.path.join(site_dir, "404.html") + with open(notfound_path, "w", encoding="utf-8") as f: + f.write(notfound_redirect_html) + # Create server-side catch-all redirect file for Netlify/Cloudflare Pages # This handles any pages not explicitly mapped in REDIRECT_MAP + # Note: This won't work on GitHub Pages, but kept for potential future use redirects_content = """# Netlify/Cloudflare Pages redirect rules # Specific redirects are handled by individual HTML redirect pages # This is the catch-all for any unmapped pages