From 2203ecbdaff20169dd721c83615c0025c63d0063 Mon Sep 17 00:00:00 2001 From: "soroush.asadi" Date: Tue, 2 Jun 2026 08:29:27 +0330 Subject: [PATCH] fix(koja): remove over-broad short-URL redirect that 500'd the home page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The redirect source "/:slug([a-z0-9][a-z0-9-]*[a-z0-9])" matched single-segment paths including the locale itself, so /fa redirected to /fa/cafe/fa (slug "fa") and /en to /fa/cafe/en — non-existent cafés that returned Internal Server Error. Visiting koja.meezi.ir (-> /fa) hit this. Removed the redirect so the home page renders; short café URLs can be re-added via middleware with reserved-word guards. Co-Authored-By: Claude Opus 4.8 --- web/koja/next.config.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/web/koja/next.config.ts b/web/koja/next.config.ts index 0a19085..a864529 100644 --- a/web/koja/next.config.ts +++ b/web/koja/next.config.ts @@ -50,16 +50,11 @@ const nextConfig: NextConfig = { { protocol: "http", hostname: "**" }, ], }, - async redirects() { - return [ - // Short URL: koja.meezi.ir/my-cafe → koja.meezi.ir/fa/cafe/my-cafe - { - source: "/:slug([a-z0-9][a-z0-9-]*[a-z0-9])", - destination: "/fa/cafe/:slug", - permanent: false, - }, - ]; - }, + // NOTE: the previous "short URL" redirect (/:slug → /fa/cafe/:slug) matched + // single-segment paths INCLUDING the locale itself, so "/fa" redirected to + // "/fa/cafe/fa" (and "/en" → "/fa/cafe/en") — a non-existent slug that 500'd + // the home page. Removed; re-add via middleware with explicit reserved-word + // exclusions if short café URLs are needed. }; export default withPWA(withNextIntl(nextConfig));