Make docs section URLs actually redirect - #5617
Conversation
✅ Deploy Preview for flowforge-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
He @dimitrieh, if we remove the frontmatter, would that also resolve this issue? As we have a redirect on Netlify in that case, we can just remove those files altogether? |
The 12 docs pages carrying `layout: redirect` redirected from inside the page component. The prerenderer turns that into an HTML file holding a `<meta http-equiv="refresh">`, and Netlify serves a matching static file in preference to a non-forced redirect rule, so /docs/install/ answered 200 with a 116-byte stub and passed nothing on to /docs/install/introduction. docs-source already walks the synced docs, so it now reads their frontmatter and registers route rules, the same mechanism nuxt/redirects.ts uses for the retired 11ty paths, and keeps those routes out of the prerender list so no stub is written. The netlify preset compiles them into dist/_redirects, which resolves them at the edge rather than in the function. The prerender filter matches any route rule that redirects, not only the ones generated here. nuxt/redirects.ts maps three underscored docs slugs to their hyphenated names, and a docs tree still carrying the underscored filename prerendered a stub that won against the rule. Verified against a full build: those three stubs disappear and no meta-refresh HTML is left in dist. Link checker reports the same 519 warnings and 0 errors as before the change.
d86a9e5 to
46ddeec
Compare
No. That frontmatter is also what builds the docs sidebar. Each of these stub pages carries navGroup, navGroupOrder, navTitle and navOrder. The leaf pages don't: docs/user/introduction.md only has navTitle and navOrder. So docs/user/README.md is the only thing saying /docs/user belongs under "FlowFuse User Manuals", first in the list. We tried this already. #5551 dropped the stubs from the sidebar. d1a2528 had to put the metadata back, because sections fell into "Other", got named after their raw path ("user", "admin"), and three groups disappeared.
There is no Netlify redirect for these paths. I checked every one. None is in nuxt/redirects.ts, and netlify.toml only has the flowforge.com to flowfuse.com rules. The frontmatter is the only place these redirects exist. Delete the files and the URLs 404. Regardless, the bug is still live. Every one of those paths answers 200 with a meta refresh on flowfuse.com right now. Rebased on main and rewrote the description, so this is ready for another look. |
Before and afterProbed both sides with the same command on 2026-09-10, after the rebase onto main: curl -s -o /dev/null -w '%{http_code} %{redirect_url}' <host><path>
Before, no path sent a Sidebar regression checkThe same stub pages define the docs nav, so I checked the sidebar still builds on the preview at Checks
|

Description
Docs section URLs do not redirect.
/docs/install/answers 200 with a<meta http-equiv="refresh">page instead of a 301. A reader still lands on the right page. A crawler or an inbound link gets nothing, because no redirect status is ever sent. This is live on flowfuse.com today.Why it happens. The docs page component redirects while rendering. The prerenderer writes that render out as a static HTML file. Netlify serves a matching static file before it consults a redirect rule, so the rule never runs.
What this changes.
docs-sourcenow reads thelayout: redirectfrontmatter at build time and turns it into a Nitro route rule. Those routes also stay out of the prerender list, so no stub file is written that could win over the rule. The netlify preset compiles the rules intodist/_redirects, and they resolve at the edge.The prerender filter matches any rule that redirects, not only the generated ones.
redirects.tsmaps a few underscored docs slugs to hyphenated names, and a docs tree still carrying the old filenames used to prerender a stub that beat the rule.The URLs this affects:
/docs/user//docs/user/introduction/docs/cloud//docs/cloud/introduction/docs/admin//docs/admin/introduction/docs/install//docs/install/introduction/docs/hardware//docs/hardware/introduction/docs/migration//docs/migration/introduction/docs/contribute//docs/contribute/introduction/docs/device-agent//docs/device-agent/introduction/docs/device-agent/install//docs/device-agent/install/overview/docs/admin/hardening//docs/admin/hardening/kubernetes//docs/admin/licensing//pricing//docs/community-support/The stub pages have to stay. Deleting them is not an alternative fix. There is no Netlify rule for any of these paths, so the frontmatter is the only place the redirect is declared. The same frontmatter is also the docs nav definition: each stub carries the
navGroup,navGroupOrder,navTitleandnavOrderits whole section is grouped and labelled by, and the leaf pages do not. #5551 dropped the stubs from the sidebar and d1a2528 had to put that metadata back.Related Issue(s)
None.
Checklist