Skip to content

Netlify's rewrite rule doesn't work with fallback pages #455

Closed
@tciesek

Description

@tciesek

Describe the bug
Netlify's rewrite rule doesn't work with fallback pages. It returns 404.

To Reproduce
Steps to reproduce the behavior:

  1. Create next.js app with path like: /posts/:id with fallback: true
  2. Set rewrite rule in _redirects file /posts/:id/:slug /posts/:id 200
  3. Deploy to netlify
  4. Go to: /posts/1 -> page is rendered
  5. 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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions