---
title: "corestack_site_rewrite_urls"
url: https://docs.corefinity.com/mcp/tools/corestack_site_rewrite_urls
type: tool
last_updated: 2026-11-13
feature: migrate
related:
  - https://docs.corefinity.com/guides/migrate/migrate-wordpress.md
---
# corestack_site_rewrite_urls

**Point a copy at its platform hostname.** Point a copied site at this row's platform hostname so it can be tested before DNS moves: every address of the given source hosts in its database (WordPress: content, home and siteurl; Magento 2: the base URLs at every scope, including those app/etc/env.php locks; Laravel: APP_URL) is rewritten to https://<platform hostname>, and the originals are saved so corestack_site_rewrite_urls_restore can put them back. On a live production row this points the live site at the platform hostname. Not available for Shopware yet: use the pending-DNS attach. Scope: write. Also needs destructive when the target is production. Long-running: answers with a task.

- Scope: `write`
- Also needs `destructive` when the row is production; D12
- Confirmation: `confirm_domain`
- Runs as a task: yes

## When to use it

Point a copied site at this row's platform hostname so it can be tested before DNS moves: every address of the given source hosts in its database (WordPress: content, home and siteurl; Magento 2: the base URLs at every scope, including those app/etc/env.php locks; Laravel: APP_URL) is rewritten to https://<platform hostname>, and the originals are saved so corestack_site_rewrite_urls_restore can put them back. On a live production row this points the live site at the platform hostname. Not available for Shopware yet: use the pending-DNS attach.

## Inputs

- `site_id` (integer, ≥ 1, required)
- `from_hosts` (array of string, up to 253 characters, 1–10 items, required): The source's own hosts, canonical first, e.g. ["www.example.com", "example.com"].
- `confirm_domain` (string, up to 253 characters): On the production row only: the site's domain, typed exactly.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "confirm_domain": {
      "description": "On the production row only: the site's domain, typed exactly.",
      "maxLength": 253,
      "type": "string"
    },
    "from_hosts": {
      "description": "The source's own hosts, canonical first, e.g. [\"www.example.com\", \"example.com\"].",
      "items": {
        "maxLength": 253,
        "type": "string"
      },
      "maxItems": 10,
      "minItems": 1,
      "type": "array"
    },
    "site_id": {
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "site_id",
    "from_hosts"
  ],
  "type": "object"
}
```

## Refusals

- `managed_elsewhere` (message: "This site is managed by another control panel"): 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.
- `not_available` (message: "Rewriting this site's addresses is not available for its platform."): the row's platform keeps its addresses where its own code chooses (a PHP site); nothing was started. Ask the person to change them in their code or its environment.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_site_rewrite_urls",
  "arguments": {
    "site_id": 4211,
    "from_hosts": [
      "example.co.uk"
    ]
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_site_rewrite_urls with site_id 4211, from_hosts ["example.co.uk"]. (Point a copy at its platform hostname.) Tell me what it returned.
```

## The same task elsewhere

- Guide: [Migrate WordPress](https://docs.corefinity.com/guides/migrate/migrate-wordpress.md)
