Operazioni sui reindirizzamenti

2 operazioni di nome redirects.*. Ognuna si esegue in un batch con apply_ops, dry_run_ops, la CLI o l’admin.

Aggiornato il
OperationWhat it doesPermissionConfirmation
redirects.readRead the draft redirects of the site: the list redirects.update replaces, each { from, to, status }.site.readnone
redirects.updateReplace the site's redirects with redirects, the whole list (at most 500; an empty list removes them all).site.editnone

redirects.read

Read the draft redirects of the site: the list redirects.update replaces, each { from, to, status }. The public site answers the redirects of its published version.

permission: site.readreads onlyclass: read

Esempio di input

{}

Input

L’input è un record: vedi lo schema qui sotto.

{
  "type": "object",
  "properties": {},
  "additionalProperties": false
}

Output

FieldTypeRequiredNotes
redirectsarray of objectyesAt most 500 items.
redirects[].fromstringyesAt most 2048 characters.
redirects[].tostringyesAt most 2048 characters.
redirects[].status301 | 302yes

Provala

yarn splash redirects.read '{}' --dry-run

redirects.update

Replace the site's redirects with redirects, the whole list (at most 500; an empty list removes them all). Each rule is { from, to, status }: from a path of this site, matched exactly with or without a trailing slash, or ending in /* to take that path and every path under it (/old/* takes /old and /old/a/b; an exact rule wins over a prefix, a longer prefix over a shorter one); to a path of this site (a query or a hash may follow; a request's query is kept when to has none) or an https:// address; status 301 (moved for good) or 302 (moved for now). A locale's paths carry its prefix (/en/old). Refused with 422 redirects_invalid, every problem named: two rules with the same from, a loop (a target that a rule of the chain redirects again), or a rule that adds or changes a from on the path of a published page (unpublish the page or change its address first; an item path of a collection page is not checked). The platform's own paths (/admin, /api, /_…) are refused. Redirects are versioned: the public site answers them, before any page renders, after the next publish; undo restores the previous list.

permission: site.editwrites: settingsclass: transactionundo: yes

Esempio di input

{
  "redirects": [
    {
      "from": "/old-about",
      "to": "/about",
      "status": 301
    },
    {
      "from": "/shop/*",
      "to": "https://shop.example.com/",
      "status": 302
    }
  ]
}

Input

FieldTypeRequiredNotes
redirectsarray of objectyesAt most 500 items.
redirects[].fromstringyesAt most 2048 characters.
redirects[].tostringyesAt most 2048 characters.
redirects[].status301 | 302yes

Output

FieldTypeRequiredNotes
redirectsarray of objectyesAt most 500 items.
redirects[].fromstringyesAt most 2048 characters.
redirects[].tostringyesAt most 2048 characters.
redirects[].status301 | 302yes

Provala

yarn splash redirects.update '{"redirects":[{"from":"/old-about","to":"/about","status":301},{"from":"/shop/*","to":"https://shop.example.com/","status":302}]}' --dry-run

Generato dal registro delle operazioni e dal catalogo degli strumenti MCP (sorgente 12f91a6db01e2760).

Qualcosa non va in questa pagina? Scrivi a docs@librettocms.com.

Guida di Libretto

Colophon. Questa guida è un sito Libretto: 70 pagine in due lingue, 21 pagine della guida importate da Markdown e 42 pagine di riferimento generate dal registro delle operazioni. Composta in Softcore, il codice in IBM Plex Mono. La sua struttura:

/it/ Guida di Libretto /it/start Per iniziare /it/start/request-access Richiedere l'accesso /it/start/workspace Il tuo spazio di lavoro /it/start/first-site Il tuo primo sito /it/start/invite-a-client Invitare un cliente /it/start/connect-claude Connettere Claude a Libretto /it/build Costruire /it/build/first-page Costruire una pagina /it/build/layers-and-canvas Livelli e canvas /it/build/site-components Componenti del sito /it/design-system Design system /it/design-system/tokens Colori, spazi e temi /it/design-system/components Componenti e varianti /it/design-system/fonts Tipografia e font /it/motion Movimento /it/motion/scenes Scene e ricette /it/motion/image-sequences Sequenze di immagini /it/motion/reduced-motion Movimento ridotto /it/publish Pubblicazione /it/publish/languages Le lingue del sito /it/publish/versions Pubblicazione e versioni /it/publish/members-and-forms Iscritti e moduli /it/publish/domains Domini /it/publish/redirects Reindirizzamenti /it/handover Consegnare un sito al cliente /it/glossary Glossario /it/agents Agenti e API /it/agents/mcp Server MCP /it/agents/cli CLI /it/agents/batches Batch /it/agents/errors Errori e segnalazioni /it/agents/operations Operazioni /it/search Cerca