Unverified Commit 1af78928 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Document redirect query passing behavior (#27545)

This documents the request query passing behavior of redirects to help avoid confusion. 

## Documentation / Examples

- [x] Make sure the linting passes

Closes: https://github.com/vercel/next.js/issues/27194
parent f3fcbef2
...@@ -52,6 +52,18 @@ module.exports = { ...@@ -52,6 +52,18 @@ module.exports = {
Redirects are checked before the filesystem which includes pages and `/public` files. Redirects are checked before the filesystem which includes pages and `/public` files.
When a redirect is applied, any query values provided in the request will be passed through to the redirect destination. For example, see the following redirect configuration:
```js
{
source: '/old-blog/:path*',
destination: '/blog/:path*',
permanent: false
}
```
When `/old-blog/post-1?hello=world` is requested, the client will be redirected to `/blog/post-1?hello=world`.
## Path Matching ## Path Matching
Path matches are allowed, for example `/old-blog/:slug` will match `/old-blog/hello-world` (no nested paths): Path matches are allowed, for example `/old-blog/:slug` will match `/old-blog/hello-world` (no nested paths):
......
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