Next.js Discord

Discord Forum

rewrite to destination with query parms

Unanswered
Acorn Woodpecker posted this in #help-forum
Open in Discord
Avatar
Acorn WoodpeckerOP
im trying to create a rewrite, where the destination has a constant query param, however the query param is not working

ex:
rewrites() {
  return [
    {
      source: "/assets/logo/icon-only",
      destination: "/api/assets/logo?displayType=icon-only"
    }
  ]
}


the query params received by /api/assets/logo are undefined, due to req.url being /assets/logo/icon-only, not /api/assets/logo?displayType=icon-only

0 Replies