fix: change to permanent redirects were applicable

This commit is contained in:
Michael Zetterberg
2025-05-27 13:39:30 +02:00
parent efbed53be4
commit 528fbbce4a
5 changed files with 12 additions and 4 deletions

View File

@@ -26,7 +26,9 @@ export const middleware: NextMiddleware = async (request) => {
const overviewUrl = overview[lang]
const redirectUrl = new URL(overviewUrl, nextUrlPublic)
console.log(`[myPages] redirecting to: ${redirectUrl}`)
return NextResponse.redirect(redirectUrl)
return NextResponse.redirect(redirectUrl, {
status: 308,
})
}
const pathNameWithoutLang = nextUrl.pathname.replace(`/${lang}`, "")