addRedirects

addRedirects

Add new redirects or update existing ones if their IDs match

await framer.addRedirects([
  { from: "/business", to: "/enterprise", expandToAllLocales: true },
  { from: "/posts/*", to: "/blog/:1", expandToAllLocales: false },
])

from paths can contain wildcards (*) which match any string, and captured groups can be referenced in the to path using :1, :2, etc.

Throws a FramerPluginError when the user lacks Site Settings permissions, when the project plan does not include Redirects, or when the maximum redirect count (2500) is reached.

Parameters

  • redirects: RedirectInput[] – An array of redirect objects to add.

Returns

  • Promise<Redirect[]> – The added Redirects.