Set up redirect for the link from the old doc to the new pages#22
Set up redirect for the link from the old doc to the new pages#22olethanh wants to merge 1 commit into
Conversation
foxpatch-aleph
left a comment
There was a problem hiding this comment.
The PR author correctly suspects the approach won't work. VitePress's rewrites option is a build-time source-path-to-URL remapping feature — it lets you serve existing source files at different URLs. It does NOT generate HTTP redirects for paths that have no corresponding source file. Since the old paths (/community/, /computing/, /guides/, etc.) have no source files in this repo, these rewrites will have no effect at runtime. Beyond the wrong mechanism, several destination paths point to pages that don't actually exist in the current doc tree (many SDK sub-pages, the management index, the ubuntu-22.04 install page). The whole approach needs to be reconsidered: true redirects must be handled at the hosting/CDN layer (e.g. Netlify/Vercel _redirects/vercel.json) or via a VitePress head meta-refresh injection for each old URL.
docs/.vitepress/config.mts (line 360): Fundamental mechanism issue: VitePress rewrites does not produce HTTP redirects. It remaps existing source-file paths to different public URLs at build time. Because the old URL paths (e.g. /community/, /computing/, /guides/) have no corresponding markdown source files in this repo, these entries will be silently ignored and old links will continue to 404. For real redirects you need to use your hosting provider's redirect config (Netlify _redirects, Vercel vercel.json redirects array, nginx rewrite rules, etc.).
docs/.vitepress/config.mts (line 413): Self-referential no-op: /nodes/compute/advanced/local-testing/ is mapped to itself. This has no effect and can be removed.
docs/.vitepress/config.mts (line 416): Destination does not exist: /nodes/compute/installation/ubuntu-22.04/ — there is no docs/nodes/compute/installation/ubuntu-22.04/ directory in the repo (only ubuntu-24.04 and debian-12 exist). This redirect would lead to a 404.
docs/.vitepress/config.mts (line 420): Destination does not exist: /nodes/resources/management/ has no index.md — only subdirectories (backups/, monitoring/, troubleshooting/) exist there. Visiting this URL will 404. Consider pointing to one of the subdirectory pages or creating an index.
docs/.vitepress/config.mts (line 389): Destination path mismatch: the target /devhub/api-reference/rest does not correspond to any markdown file. The actual file is at docs/devhub/api/rest.md, making the correct path /devhub/api/rest. (Note: this same wrong path appears in the sidebar at line 339 and is a pre-existing issue, but wiring a new redirect to it will compound the problem.)
docs/.vitepress/config.mts (line 391): Multiple broken destinations in the Python SDK section: accounts, error, forget, aggregates/create, aggregates/delegate, aggregates/query, posts/create, and posts/query are all listed as redirect targets, but only docs/devhub/sdks-and-tools/python-sdk/index.md exists. These pages haven't been created yet. The redirects should either be dropped until the pages exist, or all mapped to the SDK index (/devhub/sdks-and-tools/python-sdk/).
docs/.vitepress/config.mts (line 399): Multiple broken destinations in the TypeScript SDK section: accounts, aggregates, instances, posts, and troubleshooting sub-pages don't exist — only docs/devhub/sdks-and-tools/typescript-sdk/index.md is present. Same fix as above.
docs/.vitepress/config.mts (line 443): Broken destinations for Aleph CLI: /devhub/sdks-and-tools/aleph-cli/troubleshooting and /devhub/sdks-and-tools/aleph-cli/usage don't exist. The CLI docs only have an index.md and commands/ subdirectory pages. Consider redirecting to the CLI index or to the appropriate commands/ sub-page.
docs/.vitepress/config.mts (line 376): Destination /devhub/compute-resources/functions/advanced/custom-builds/ has no index.md — there is no directory-level page there, only python/ and rust.md children. This will 404; redirect to a specific child instead.
docs/.vitepress/config.mts (line 360): Style nit: the rewrites block uses 4-space indentation while the rest of config.mts uses 2 spaces. Please normalise.
docs/.vitepress/config.mts (line 457): Missing newline at end of file.
I generated the list via Claude with a bit of corrections by hand. But I haven't been able to test it as from what I understand VitePress don't handle redirections itself.
Claude and OpenAI insist that is how redirect are not but I'm not terribly convinced.
It may depends on how the documentation is deployed if it works or not and I'm not sure how it is done.