---
title: "corestack_redirects_import"
url: https://docs.corefinity.com/mcp/tools/corestack_redirects_import
type: tool
last_updated: 2026-11-13
feature: redirects
related:
  - https://docs.corefinity.com/api/reference/site-settings/import-site-redirects.md
  - https://docs.corefinity.com/guides/sites/site-settings/redirects.md
---
# corestack_redirects_import

**Read a redirects file.** Turn an nginx, Apache or CSV redirects file into rules for a row, with what was skipped or rejected and why. Nothing is saved: send the rules you want with corestack_redirects_update. Scope: read.

- Scope: `read`
- Runs as a task: no

## When to use it

Turn an nginx, Apache or CSV redirects file into rules for a row, with what was skipped or rejected and why. Nothing is saved: send the rules you want with corestack_redirects_update.

## Inputs

- `site_id` (integer, ≥ 1, required)
- `format` (one of `nginx`, `apache`, `csv`, required)
- `content` (string, up to 524288 characters, required): The file's text (at most 512 KiB).
- `hosts` (array of strings, each up to 253 characters, at least 1, or null): Apply to: limit every rule that names no domains of its own (a CSV `hosts` column) to these of the row's domains; absent or null leaves them on every domain.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "content": {
      "description": "The file's text (at most 512 KiB).",
      "maxLength": 524288,
      "type": "string"
    },
    "format": {
      "enum": [
        "nginx",
        "apache",
        "csv"
      ],
      "type": "string"
    },
    "hosts": {
      "description": "Apply to: limit every rule that names no domains of its own (a CSV hosts column) to these of the row's domains; absent or null leaves them on every domain.",
      "items": {
        "maxLength": 253,
        "type": "string"
      },
      "minItems": 1,
      "type": [
        "array",
        "null"
      ]
    },
    "site_id": {
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "site_id",
    "format",
    "content"
  ],
  "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.
- 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_redirects_import",
  "arguments": {
    "site_id": 4211,
    "format": "csv",
    "content": "/old-page,/new-page,301\n/summer-sale,/offers,302\n"
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_redirects_import with site_id 4211, format csv, content /old-page,/new-page,301
/summer-sale,/offers,302
. (Read a redirects file.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [POST /api/corestack/sites/{site}/redirects/import](https://docs.corefinity.com/api/reference/site-settings/import-site-redirects.md)
- Guide: [Redirects](https://docs.corefinity.com/guides/sites/site-settings/redirects.md)
