Skip to content

Commit

Permalink
✏️ logic adjustment #2619
Browse files Browse the repository at this point in the history
  • Loading branch information
millianapia committed Oct 31, 2024
1 parent 4772d40 commit 7d42550
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ export async function middleware(request: NextRequest) {
}

// Skip WWW redirect for Radix URLs
if (host === process.env.NEXT_PUBLIC_RADIX_URL || process.env.RADIX_CANONICAL_DOMAIN_NAME) {
if (host !== process.env.NEXT_PUBLIC_RADIX_URL || host !== process.env.RADIX_CANONICAL_DOMAIN_NAME) {
const wwwRedirect = getWWWRedirect(host, pathname)
if (wwwRedirect) {
return NextResponse.redirect(wwwRedirect, PERMANENT_REDIRECT)
}
}

// Redirect external links to news which is now archived if link doesn't exist in Sanity
if (Flags.HAS_ARCHIVED_NEWS && pathname.startsWith('/news') && !pathname.startsWith('/news/archive')) {
const existsInSanity = await pathExistsInSanity(pathname, isPreview)
Expand Down

0 comments on commit 7d42550

Please sign in to comment.