Files
vercel__next.js/test/e2e/app-dir/rewrite-headers/next.config.js
Andrew Clark 7a183a0f3f Fix: Unresolved param in x-nextjs-rewritten-query (#81991)
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`
2025-07-23 20:45:00 -04:00

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',
},
]
},
}