Closed
Description
Describe the bug
Netlify's rewrite rule doesn't work with fallback pages. It returns 404.
To Reproduce
Steps to reproduce the behavior:
- Create next.js app with path like:
/posts/:id
withfallback: true
- Set rewrite rule in
_redirects
file/posts/:id/:slug /posts/:id 200
- Deploy to netlify
- Go to: /posts/1 -> page is rendered
- Go to: /posts/1/seo-friendly-name -> page is NOT rendered and we get 404
Expected behavior
The fallback page is rendered correctly for rewrite rules.
Versions
- Next.js: 10.1.3
- plugin: 3.4.2
If you're using file-based installation
- netlify.toml:
[build]
command = "next build"
publish = "out"
[[plugins]]
package = "@netlify/plugin-nextjs"
[context.production.environment]
NEXT_SERVERLESS = "true"
NODE_ENV = "production"