Hello,
We are having problems with returning 404 page in correct language on the NextJS website with enabled internationalization. The website is deployed via SSG and has a custom 404 page.
Direct link to 404 page:
https://develop--biobest.netlify.app/nl/404 → gives back generated 404 page in correct language (NL): Page not found [nl]
https://develop--biobest.netlify.app/404 → gives back generated 404 page in correct language (default=EN): Page not found.
However, when requesting really non-existing page, the problem appears:
https://develop--biobest.netlify.app/nl/this-page-really-doesnt-exist
expected: 404 page in NL
actual: 404 page in EN
Could you please have a look into it? How can we fix it?
I have also checked at the redirects deployed with the website and found there these rules in the deploy log:
<skipped logs>
2:45:45 PM: { from: '/', to: '/en/404.html', status: 404, force: false },
2:45:45 PM: { from: '/*', to: '/en/404.html', status: 404, force: false },
<skipped logs>
2:45:45 PM: { from: '/nl', to: '/nl/404.html', status: 404, force: false },
2:45:45 PM: { from: '/nl/*', to: '/nl/404.html', status: 404, force: false },
<skipped logs>
My assumption would be that the order of these redirects is inverted → when /nl/non-existing is requested, the top rule redirects to /en/404. While instead, the order should be swapped, so that /nl/* is processed before /*
Is there a workaround for this?
Kind regards,
Max