Deprecate and remove pcm and fil locales#16804
Conversation
✅ Deploy Preview for ethereumorg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
0f4adc2 to
0a6b18e
Compare
0a6b18e to
79e067e
Compare
| { source: "/no/:path*", destination: "/nb/:path*", permanent: true }, | ||
| { source: "/ph/:path*", destination: "/fil/:path*", permanent: true }, |
There was a problem hiding this comment.
@corwintines @wackerow these redirects for deprecated locales (/pcm, /fil, /ph) and the Norwegian alias (/no → /nb) were working fine locally but not on Netlify.
The reson is that, on Netlify Edge, the next-intl middleware runs before Next.js processes the redirects in next.config.js. So when someone hit /pcm/some-page, the middleware intercepted it first, didn't recognize pcm as a valid locale, and returned a 404 instead of redirecting to the English version.
By handling these locale redirects directly in the middleware (before next-intl does its thing), we ensure they work consistently everywhere — local dev, Netlify preview deploys, and prod.
wackerow
left a comment
There was a problem hiding this comment.
Lgtm! Working well in Netlify preview... ph fil and pcm being stripped out appropriately, and any further redirects for paths are being applied. /no going to /nb along with any other applicable redirects. 👍

Description
Removes support for
pcm(Nigerian Pidgin) andfil(Filipino) locales and adds temporary 307 redirects to the default locale.