Docs: Config based redirects should advised that they are assessed at build time
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
What is the improvement or update you wish to see?
Redirects are checked before the filesystem which includes pages and /public files.
Redirects are not applied to client-side routing (Link, router.push), unless Middleware is present and matches the path.
I recommend we add a new line between these two that advises...
Redirects are checked before the filesystem which includes pages and /public files.
Redirects are assessed at build time only and will not be fixed once the application is built.
Redirects are not applied to client-side routing (Link, router.push), unless Middleware is present and matches the path.
Is there any context that might help us understand?
Reading through this page, it is not very obvious that the Redirects will be 'fixed' once the build is done, that these redirects will not change based on the request/environment variables. The only way to make a dynamic redirect is to use the syntax in the config or to reach for something like Middleware or SSR props based redirects.
I am happy to make a PR for this change if that's helpful.
Does the docs page already exist? Please link to it.
https://nextjs.org/docs/pages/api-reference/next-config-js/redirects
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open docs/pages/api-reference/next-config-js/redirects.md and review the redirects section around the linked documentation lines. Add a note explaining that config-based redirects are assessed at build time, then verify that the wording clearly distinguishes them from client-side routing and dynamic alternatives.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- next.js
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100