Skip to content

Commit

Permalink
middleware: redirect instead of rewrite so analytics picks up mobile …
Browse files Browse the repository at this point in the history
…visits
  • Loading branch information
sehyunc committed Sep 7, 2024
1 parent a653d40 commit d6e2436
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function middleware(request: NextRequest) {
if (device.type === "mobile") {
if (request.nextUrl.pathname !== "/m") {
request.nextUrl.pathname = "/m"
return NextResponse.rewrite(request.nextUrl)
return NextResponse.redirect(request.nextUrl)
}
return
}
Expand Down

0 comments on commit d6e2436

Please sign in to comment.