mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
7a183a0f3f
Fixes an issue with the x-nextjs-rewritten-query header where it responded without the dynamic parts of the URL filled in. For example, when rewriting to `/hello?id=123` to `/hello/123`: - Before: `x-nextjs-rewritten-query: id=__ESC_COLON_id` - After: `x-nextjs-rewritten-query: id=123`
28 lines
572 B
JavaScript
28 lines
572 B
JavaScript
/** @type {import('next').NextConfig} */
|
|
module.exports = {
|
|
rewrites: async () => {
|
|
return [
|
|
{
|
|
source: '/hello/sam',
|
|
destination: '/hello/samantha',
|
|
},
|
|
{
|
|
source: '/hello/other',
|
|
destination: '/other',
|
|
},
|
|
{
|
|
source: '/hello/fred',
|
|
destination: '/other?key=value',
|
|
},
|
|
{
|
|
source: '/hello/(.*)/google',
|
|
destination: 'https://www.google.$1/',
|
|
},
|
|
{
|
|
source: '/rewrites-to-query/:name',
|
|
destination: '/other?key=:name',
|
|
},
|
|
]
|
|
},
|
|
}
|