From 30436c5c1d80f9b2d3579f974e6e4d643ddb696b Mon Sep 17 00:00:00 2001 From: Benjamin Pagelsdorf Date: Tue, 12 Mar 2024 13:45:34 +0100 Subject: [PATCH] fix(landingpage): prevent redirection to 404 (#1311) remove trailing slash in route path --- packages/landingpage/app/not-found.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/landingpage/app/not-found.tsx b/packages/landingpage/app/not-found.tsx index ef63403782..46ef9d0130 100644 --- a/packages/landingpage/app/not-found.tsx +++ b/packages/landingpage/app/not-found.tsx @@ -9,6 +9,10 @@ export default function NotFound() { const pathName = usePathname(); useEffect(() => { + if (pathName.endsWith('/')) { + return router.replace(pathName.slice(0, -1)); + } + const [lang] = navigator.language.split('-'); const fallbackLang = getValidLang(lang);