Unverified Commit a1e16dc9 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Update rewrites doc to mention they are applied to client-side routing (#25099)



Updates an old message in the docs that caused some confusion here: https://github.com/vercel/next.js/issues/24904#issuecomment-837086983

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [ ] Make sure the linting passes
parent 40e178e6
......@@ -25,8 +25,6 @@ Rewrites allow you to map an incoming request path to a different destination pa
Rewrites act as a URL proxy and mask the destination path, making it appear the user hasn't changed their location on the site. In contrast, [redirects](/docs/api-reference/next.config.js/redirects.md) will reroute to a new page a show the URL changes.
Rewrites are only available on the Node.js environment and do not affect client-side routing.
To use rewrites you can use the `rewrites` key in `next.config.js`:
```js
......@@ -42,6 +40,8 @@ module.exports = {
}
```
Rewrites are applied to client-side routing, a `<Link href="/about">` will have the rewrite applied in the above example.
`rewrites` is an async function that expects an array to be returned holding objects with `source` and `destination` properties:
- `source`: `String` - is the incoming request path pattern.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment