fix(koja): remove over-broad short-URL redirect that 500'd the home page
CI/CD / CI · API (dotnet build + test) (push) Failing after 3m18s
CI/CD / CI · Admin API (dotnet build) (push) Failing after 2m22s
CI/CD / CI · Dashboard (tsc) (push) Successful in 1m5s
CI/CD / CI · Admin Web (tsc) (push) Successful in 36s
CI/CD / CI · Website (tsc) (push) Successful in 45s
CI/CD / CI · Koja (tsc) (push) Successful in 50s
CI/CD / Deploy · all services (push) Has been skipped

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 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-02 08:29:27 +03:30
parent 1aaab6c593
commit 2203ecbdaf
+5 -10
View File
@@ -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));