Skip to content

Commit

Permalink
Added middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
erland-syafiq committed Jun 6, 2024
1 parent 11ebc76 commit 9cf8614
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions site/middleware.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { NextResponse } from "next/server";

export function middleware(request) {

if (/[A-Z]/.test(request.nextUrl.pathName)) {
const url = request.nextUrl.clone();
url.pathname = pathname.toLowerCase();
return NextResponse.redirect(url);
}

return NextResponse.next();
}

0 comments on commit 9cf8614

Please sign in to comment.