Open yesitsdave opened 3 years ago
For redirects and rewrites to work properly in NextJs, you also need to ensure one more thing:
If you are using trailingSlash: true
then your source paths must end with a slash.
{
source: '/old/:id/', // Notice the slash at the end
destination: '/new/:id',
},
Any other plugins or configurations that interfere with routing also need to be taken into account.
Using next 10.0.3, it seems that
async redirects()
in the config is ignored if using next-images.Other config options work fine, but pages which should be redirecting just return 404. Removing next-images fixes the issue.