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:
parent
47d7565d04
commit
f5dcc3c804
|
|
@ -8,10 +8,10 @@ export function middleware(request: NextRequest) {
|
||||||
return NextResponse.redirect(new URL("/gate", request.url))
|
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") || ""
|
const host = request.headers.get("host") || ""
|
||||||
if (host.startsWith("music.") && request.nextUrl.pathname === "/") {
|
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()
|
return NextResponse.next()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue