CorefinityCorefinityDocs
Open the Control PanelControl Panel
Redirects · 2 of 5

corestack_redirects_update

Change redirects.

Scope writeRuns as a taskNo secrets returnedCoreCluster
On this page

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

Prompt
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

rulesarray of objectsRequired

Up to 2,000 items.

Fields of each item
enabledbooleanRequired
fromstringRequired

Up to 2,000 characters.

hostsarray of strings or null

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.

idinteger or null

An existing rule's id; leave it out (or null) for a new rule. At least 1.

keep_querybooleanRequired
notestring or null

Up to 120 characters.

statusintegerRequired
301302
tostringRequired

Up to 2,000 characters.

typestringRequired
exactprefixregex
site_idintegerRequired

At least 1.

versionintegerRequired

The table's version from corestack_redirects_get. At least 0.

Example call

tools/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

ReasonWhat to do
staleThe object changed since you read it; read it again and call with the new version.
invalid_argumentsOn 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_failedThe 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_elsewhereAnother 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_mismatchThe object does not exist or the token may not see it. Check the id.
scope_requiredThe token lacks a scope this call needs. Open the link in the answer to add it, then call again.
pin_refusedThe 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_limitedToo many calls. Wait for the number of seconds the answer names.
temporarily_unavailableThe Control Panel could not answer just now. Nothing was started; try again shortly.
internal_errorSomething went wrong on our side. Quote the trace id to support.

The same task elsewhere

Was this helpful?
Open in ClaudeOpen in ChatGPT