From c4207cfd3a65f4be241e57125ee42aadaf023d58 Mon Sep 17 00:00:00 2001 From: Debian Dev4 Date: Wed, 24 Sep 2025 16:41:13 +0000 Subject: [PATCH] fix(next): remove middleware/redirects and disable trailingSlash to avoid loop; rely on Nginx redirect --- middleware.ts | 19 +------------------ next.config.js | 12 +----------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/middleware.ts b/middleware.ts index c061015e..f49a5bf7 100644 --- a/middleware.ts +++ b/middleware.ts @@ -1,18 +1 @@ -import { NextResponse } from 'next/server'; -import type { NextRequest } from 'next/server'; - -export function middleware(request: NextRequest) { - const { pathname } = request.nextUrl; - if (pathname === '/lecoffre') { - const url = request.nextUrl.clone(); - url.pathname = '/lecoffre/'; - return NextResponse.redirect(url, 308); - } - return NextResponse.next(); -} - -export const config = { - matcher: ['/lecoffre'], -}; - - +// Disabled: trailing slash handled by Nginx diff --git a/next.config.js b/next.config.js index b3dbd1a9..b1c576ca 100644 --- a/next.config.js +++ b/next.config.js @@ -5,17 +5,7 @@ const nextConfig = { output: 'standalone', basePath: '/lecoffre', assetPrefix: '/lecoffre', - trailingSlash: true, - async redirects() { - return [ - { - source: '/lecoffre', - destination: '/lecoffre/', - permanent: false, - // basePath applies by default - }, - ]; - }, + trailingSlash: false, typescript: { ignoreBuildErrors: true, },