Skip to content

Custom Netlify Redirects Overwritten #158

Closed
@juanpprieto

Description

@juanpprieto

Describe the bug
netlify-plugin-nextjs seems to overwrite custom _redirects file rules

To Reproduce
Steps to reproduce the behavior:

  1. Add custom rules to: public/_redirects
  2. netlify build
  3. Check out_publish/_redirects includes only # Next-on-Netlify Redirects....

Expected behavior
I would expect to see the custom redirect rules merged in at the very top of the out_publish/_redirects file

Versions

  • Next.js: "next": "^10.0.3"
  • plugin (if installed at fixed version): "@netlify/plugin-nextjs": "^3.0.0"

If you're using the CLI to build

  • OS: [e.g. macOS, Windows]: Mac
  • netlify/cli version: netlify-cli@3.10.5

If you're using file-based installation

  • netlify.toml:
# netlify.toml

[build]
  # base = "storefront/"
  command   = "yarn build"
  publish   = "storefront/out_publish"
  functions = "storefront/out_functions"

[dev]
  functions = "out_functions"
  publish   = "out_publish"
  framework = "#static"

# needs to be included before
[[plugins]]
  package = "/plugins/my-custom-plugin"
   [plugins.inputs]
    build_dir_path = "storefront"
    build_dir = ".next"
    json_dir = "public/json"

[[plugins]]
  package = "@netlify/plugin-nextjs"

Custom _redirects

#### PRODUCTS REDIRECTS START ####
/json/products/navy-feel-good-short-sleeve-shirt /json/products/navy-feel-good-short-sleeve-shirt___2021-03-16T22:24:05Z.json 200
.......
#### PRODUCTS REDIRECTS END ####

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions