diff --git a/apps/scandic-web/middlewares/cmsContent.ts b/apps/scandic-web/middlewares/cmsContent.ts index 520b15ee4..855e7f9ac 100644 --- a/apps/scandic-web/middlewares/cmsContent.ts +++ b/apps/scandic-web/middlewares/cmsContent.ts @@ -43,6 +43,11 @@ export const middleware: NextMiddleware = async (request) => { contentType = parentContentType uid = parentUid switch (parentContentType) { + // If the parent is the startpage, we should not be able to resolve a subpage. + case PageContentTypeEnum.startPage: + throw notFound( + `Unable to resolve CMS entry for page "${pathWithoutTrailingSlash}"` + ) case PageContentTypeEnum.hotelPage: // E.g. Dedicated pages for restaurant, parking etc. searchParams.set("subpage", subpage)