From d854b903e086262515a8fe219ad10234be06344a Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Wed, 20 May 2026 23:59:10 +0200 Subject: [PATCH] fix: anchor unmatched URLs into main so 404 renders --- app/(main)/[...rest]/page.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 app/(main)/[...rest]/page.tsx diff --git a/app/(main)/[...rest]/page.tsx b/app/(main)/[...rest]/page.tsx new file mode 100644 index 00000000..093739e8 --- /dev/null +++ b/app/(main)/[...rest]/page.tsx @@ -0,0 +1,10 @@ +import { notFound } from 'next/navigation'; + +// Catch-all that anchors unmatched URLs into the (main) route group so +// Next renders app/(main)/not-found.tsx (wrapped by (main)/layout.tsx) +// instead of the built-in __next_builtin__not-found page. Without this, +// route groups can't pick a root layout for URLs that match nothing, so +// 404s render bare. +export default function CatchAll() { + notFound(); +}