Closed thainv92 closed 7 months ago
@QuiiBz I really hope to receive support from your reply.
Sorry for the delay, I started a new job recently. You have to update the source
field to take into account the locale
dynamic param:
/** @type {import('next').NextConfig} */
const nextConfig = {
async rewrites() {
return [
{
source: "/:locale/blog",
destination: "https://example.com/blog",
},
{
source: "/:locale/blog/:slug",
destination: "https://example.com/blog/:slug", // Matched parameters can be used in the destination
},
];
},
};
I've tested it here and it's working as expected when navigating to /en/blog
or /blog
directly.
Describe the bug Rewrites config working when use middleware next-international
To Reproduce Steps to reproduce the behavior: Your demo: https://codesandbox.io/p/devbox/next-international-app-router-forked-j9wq2k?file=%2Fpackage.json%3A17%2C4-18%2C36
module.exports = nextConfig;