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
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:
+5
-10
@@ -50,16 +50,11 @@ const nextConfig: NextConfig = {
|
|||||||
{ protocol: "http", hostname: "**" },
|
{ protocol: "http", hostname: "**" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
async redirects() {
|
// NOTE: the previous "short URL" redirect (/:slug → /fa/cafe/:slug) matched
|
||||||
return [
|
// single-segment paths INCLUDING the locale itself, so "/fa" redirected to
|
||||||
// Short URL: koja.meezi.ir/my-cafe → koja.meezi.ir/fa/cafe/my-cafe
|
// "/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
|
||||||
source: "/:slug([a-z0-9][a-z0-9-]*[a-z0-9])",
|
// exclusions if short café URLs are needed.
|
||||||
destination: "/fa/cafe/:slug",
|
|
||||||
permanent: false,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withPWA(withNextIntl(nextConfig));
|
export default withPWA(withNextIntl(nextConfig));
|
||||||
|
|||||||
Reference in New Issue
Block a user