corestack_ redirects_ update
Change redirects.
When to use it
Replace a row's whole redirect table: send every rule you want to keep, in the order they should be tried — rules left out are removed — with the version corestack_redirects_get answered. A rule whose path is the address asked for (an exact rule, or a prefix rule's own path) is taken first whatever its position; prefix and regex rules are then tried in order. Rules limited to a domain run before the every-domain rules.
Ask for it
Using the Corefinity MCP server, call corestack_redirects_update with site_id 4211, version 3, rules [{"type":"exact","from":"/old-page","to":"/new-page","status":301,"keep_query":true,"enabled":true}]. (Change redirects.) Tell me what it returned.Inputs
Up to 2,000 items.
Fields of each item
Up to 2,000 characters.
CPPB-1170: limit the rule to some of the row's own domains (corestack_redirects_get's available_hosts); null runs it on every domain. Left out on a saved rule, the rule keeps the domains it has. On its domains a limited rule runs before the every-domain rules, and never on the platform's reserved paths.
An existing rule's id; leave it out (or null) for a new rule. At least 1.
Up to 120 characters.
301302Up to 2,000 characters.
exactprefixregexAt least 1.
The table's version from corestack_redirects_get. At least 0.
Example call
{
"name": "corestack_redirects_update",
"arguments": {
"site_id": 4211,
"version": 3,
"rules": [
{
"type": "exact",
"from": "/old-page",
"to": "/new-page",
"status": 301,
"keep_query": true,
"enabled": true
}
]
}
}If it is refused
| Reason | What to do |
|---|---|
stale | The object changed since you read it; read it again and call with the new version. |
invalid_arguments | On rules.<i>.from, "… is already an exact location in your nginx rules (line N)" (or "in your path apps"): an exact or prefix rule on every domain adds location = <from>, and nginx refuses a second exact location for one path. Change the rule, or remove that location with corestack_nginx_rules_update first. A prefix location (location /old), a regex location and a rule limited to some domains never collide. |
work_failed | The task's operation or deployment ended failed; details carries the record; read details; the person may retry with corestack_operation_retry where it applies. |
managed_elsewhere | Another control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done. |
tenant_mismatch | The object does not exist or the token may not see it. Check the id. |
scope_required | The token lacks a scope this call needs. Open the link in the answer to add it, then call again. |
pin_refused | The grant is limited to chosen clusters, sites or environments, and this call is outside them. Open the link in the answer to widen it. |
rate_limited | Too many calls. Wait for the number of seconds the answer names. |
temporarily_unavailable | The Control Panel could not answer just now. Nothing was started; try again shortly. |
internal_error | Something went wrong on our side. Quote the trace id to support. |