for rewrite everything else to/[domain]/[path] dynamic routein the middleware file is givenreturn NextResponse.rewrite(new URL(/${hostname}${path}, req.url));which is not correct because in the URL it creates href as'http://localhost:3000/test.localhost:3000/'when I try to gotest.localhost:3000. also in the/[domain]/page.tsxparams it generates is{ domain: 'test.localhost%3A3000' }`
this PR resolves the issue. It creates href as 'http://localhost:3000/test/' in the URL and also in the /[domain]/page.tsx params it generates is { domain: 'test' }
for
rewrite everything else to
/[domain]/[path] dynamic routein the middleware file is given
return NextResponse.rewrite(new URL(/${hostname}${path}
, req.url));which is not correct because in the URL it creates href as
'http://localhost:3000/test.localhost:3000/'when I try to go
test.localhost:3000. also in the
/[domain]/page.tsxparams it generates is
{ domain: 'test.localhost%3A3000' }`this PR resolves the issue. It creates href as
'http://localhost:3000/test/'
in the URL and also in the/[domain]/page.tsx
params it generates is{ domain: 'test' }