fix: rewrite music.jefflix.lol root instead of redirect

Use NextResponse.rewrite so the URL stays as music.jefflix.lol/
instead of redirecting to music.jefflix.lol/music.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-03-31 19:21:36 -07:00
parent 47d7565d04
commit f5dcc3c804
1 changed files with 2 additions and 2 deletions

View File

@ -8,10 +8,10 @@ export function middleware(request: NextRequest) {
return NextResponse.redirect(new URL("/gate", request.url))
}
// Auto-redirect music.jefflix.lol root to /music
// Rewrite music.jefflix.lol root to /music (URL stays clean)
const host = request.headers.get("host") || ""
if (host.startsWith("music.") && request.nextUrl.pathname === "/") {
return NextResponse.redirect(new URL("/music", request.url))
return NextResponse.rewrite(new URL("/music", request.url))
}
return NextResponse.next()