Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirects not working when using next-images #69

Open
yesitsdave opened this issue Apr 21, 2021 · 1 comment
Open

Redirects not working when using next-images #69

yesitsdave opened this issue Apr 21, 2021 · 1 comment

Comments

@yesitsdave
Copy link

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.

@muditgoel01
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants