diff --git a/middleware.js b/middleware.js index f403f105802..8c11e9c9186 100644 --- a/middleware.js +++ b/middleware.js @@ -7,7 +7,11 @@ export const config = { }; export async function middleware(req) { - const reqPathName = req.nextUrl.pathname; + const path = req.nextUrl.pathname; - return NextResponse.redirect(new URL(reqPathName, "https://github.com")); + if (path !== "/") { + return NextResponse.redirect(new URL(path, "https://github.com")); + } + + return NextResponse.next(); }