Write redirects
redirects_applyWrite redirects (from a path, to a path or full address, code 301 or 302) into the site's redirect store: Magento url_rewrite, or the WordPress Redirection or Rank Math plugin. With dry_run left at true (the default) it only shows what would be written. On a site without a redirect store it returns the nginx and Apache lines to place with write_file instead. Every redirect is one path to one address; no patterns. Answers with a batch id for redirects_undo.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"changes": "<changes>"
},
"name": "redirects_apply"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | No | Site root folder or one of its domains. Optional when the server has one site. | |
| server | No | Server name or id. Optional when the account has one server. | |
| changes | Yes | For apply. | |
| dry_run | No | For apply. Default true: preview only. |