# Redirect Map Tester – Site Migration QA (`plainwren/redirect-map-tester`) Actor

For your own or authorised sites. Give it a list of old URLs and the target you expect each one to reach in a single redirect, and it reports PASS, wrong target, chains, loops and broken destinations. $0.001 per URL checked; timeouts and guard blocks are free.

- **URL**: https://apify.com/plainwren/redirect-map-tester.md
- **Developed by:** [Plainwren Studio](https://apify.com/plainwren) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 url checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What is Redirect Map Tester?

**Redirect Map Tester** checks a list of old URLs against the targets you expect, for your own or authorised sites. It is built for site migrations and redirect-map QA: give it the old URL and the destination you want, and it reports whether the redirect is right.

- For each old URL it records the final URL, final status, hop count and the redirect chain (`[{url, status}]`).
- Results: `PASS`, `WRONG_TARGET`, `WRONG_STATUS`, `CHAIN` (more than one hop, or over the hop cap), `LOOP`, `NOT_REDIRECTED`, `BROKEN` (an HTTP 4xx/5xx or a transport failure), `GUARD_BLOCKED`, `BAD_URL`, `DUPLICATE`.
- Input is a list of `{ oldUrl, expectedUrl?, expectedStatus? }`, or a CSV with those columns. `expectedUrl` is optional: without it the row is a plain status and chain check.
- Up to 5,000 URLs per run. Extra URLs are skipped, not charged, and reported.
- It does not crawl, does not follow links on the page, does not keep page bodies, and does not log in.

Try it: leave the input empty and click **Start**. The Actor runs a free demo of the trailing-slash redirect <https://tools.plainwrenstudio.com/bots> → <https://tools.plainwrenstudio.com/bots/> (one 308 hop).

Support: <support@plainwrenstudio.com>. Bot info: [tools.plainwrenstudio.com/bots/redirect-map-tester/](https://tools.plainwrenstudio.com/bots/redirect-map-tester/).

### Who is it for?

- 🧑‍💻 **Site owners and developers** checking a migration redirect map before or after a go-live.
- 🔗 **SEO teams and agencies** confirming that listed old URLs reach the expected targets, with a CSV or HTML report.
- 🤖 **Automations and agents** through the Apify API, schedules and integrations.

### Use cases

- Check a site-migration redirect map: list up to 5,000 old URLs and the target you expect each one to reach, and get PASS, WRONG_TARGET, WRONG_STATUS, CHAIN, LOOP, NOT_REDIRECTED or BROKEN.
- Paste a CSV of `oldUrl` and `expectedUrl` and download a CSV or HTML report. Timeouts and guard blocks are free; an HTTP 4xx/5xx destination is BROKEN and is charged.
- Confirm a single-hop redirect (the usual migration 301, or a 308 like the built-in demo) without crawling past the URLs you list.

### How to check a redirect map

1. Open the **Input** tab and add rows under **Redirect map** (`oldUrl`, optional `expectedUrl` and `expectedStatus`), or paste a CSV. Leave the list empty to run the free demo.
2. Optional: change the default expected status (301 unless a row sets its own; the demo row uses 308), the hop cap, trailing-slash or query comparison, or the polite rate.
3. Click **Start**.
4. Read the dataset, or download `REPORT.csv` / `REPORT.html` from the key-value store.

#### Input example

```json
{
  "mappings": [
    {
      "oldUrl": "https://tools.plainwrenstudio.com/bots",
      "expectedUrl": "https://tools.plainwrenstudio.com/bots/",
      "expectedStatus": 308
    }
  ],
  "expectedStatus": 301,
  "maxHops": 5,
  "requestsPerSecond": 2
}
```

| Field | Type | What it does |
|---|---|---|
| `mappings` | array | Rows of `{ oldUrl, expectedUrl?, expectedStatus? }`. Max 5,000. Leave empty (and `csv` empty) for the free demo. |
| `csv` | string | Optional CSV with a header (`oldUrl, expectedUrl`) or two columns without a header, merged into the list. |
| `expectedStatus` | integer (default 301) | Used when a row does not set its own. The demo row sets 308, which is what the sample host returns. |
| `maxHops` | integer (default 5, max 10) | Follow at most this many redirects. A longer chain is reported as `CHAIN`. |
| `ignoreTrailingSlash` / `ignoreQuery` | boolean (default `false`) | Only affect how the final URL is compared to `expectedUrl`. |
| `requestsPerSecond` | number (default 2) | Per host, one request at a time. Every hop counts. |
| `maxConcurrency` | integer (default 4, max 10) | How many different hosts are checked at once. |
| `timeoutSecs` | integer (default 15) | A timeout is reported as `BROKEN` and is not charged. |

### How much does it cost?

Redirect Map Tester uses **pay-per-event** pricing:

- **$0.001 per URL checked** (`url-checked`) when the check completed with a usable HTTP answer (PASS and the mismatch or broken-destination results).
- A small **run start** fee of **$0.001 per GB** of run memory: $0.001 per run at the default 1 GB.
- **Free:** the demo run, timeouts, DNS or TLS failures, guard blocks, bad URLs, duplicates, and URLs over the 5,000 cap.

You can set a spending limit on any run. When it is reached, the run stops cleanly and tells you how many URLs were skipped (not charged).

### Limits

- **For your own or authorised sites.**
- **No crawling.** It checks only the old URLs you list, then follows each `Location` hop (up to the hop cap) after running the same address guard again.
- **No page content.** Only status codes and redirect targets are kept. Bodies are discarded.
- **No logins, cookies or custom headers.**
- **No private or internal addresses**, including through redirects.
- **Polite by design:** one request at a time per host, two per second by default (you can set 0.2 to 4). Up to four hosts at once by default, never more than ten.
- **Memory:** 1024 MB by default (this is a plain HTTP Actor; it does not launch Chrome).

### FAQ

#### Do I need to tick anything for the demo?

No. Leave the map empty, or use exactly the built-in sample row for `https://tools.plainwrenstudio.com/bots` → `https://tools.plainwrenstudio.com/bots/`, and the run is free.

#### What user agent does it use?

`PlainwrenRedirectMap/1.0 (+https://tools.plainwrenstudio.com/bots/redirect-map-tester/)`.

#### Does it obey robots.txt?

No. It only requests the old URLs you list and their redirect targets.

#### Am I charged when a check fails?

Timeouts, DNS or TLS failures, guard blocks, bad URLs and duplicates are free. An HTTP 4xx/5xx destination is reported as `BROKEN` and is charged, because the check completed with an HTTP answer.

# Actor input Schema

## `mappings` (type: `array`):

Rows of { oldUrl, expectedUrl?, expectedStatus? }. expectedUrl is optional: without it the row is a plain status and chain check. If you leave this empty (and csv empty), the run does a free demo of the trailing-slash redirect https://tools.plainwrenstudio.com/bots → https://tools.plainwrenstudio.com/bots/ (one 308 hop).

## `csv` (type: `string`):

Optional CSV with a header row (oldUrl, expectedUrl) or two columns without a header. Added to the list above. Max about 2 MB.

## `expectedStatus` (type: `integer`):

Default for rows that do not set their own expectedStatus. 301 is the usual migration code. The built-in demo row sets 308, which is what the sample host actually returns. 200-599.

## `maxHops` (type: `integer`):

Follow at most this many redirects (1-10, default 5). A longer chain is reported as CHAIN and not followed further.

## `ignoreTrailingSlash` (type: `boolean`):

Treat /page and /page/ as the same target.

## `ignoreQuery` (type: `boolean`):

Treat ?utm=... variants as the same target.

## `requestsPerSecond` (type: `number`):

Polite rate on each host, one request at a time (0.2-4, default 2). Every hop counts as a request.

## `maxConcurrency` (type: `integer`):

How many different hosts are checked at the same time (1-10, default 4). Each host still gets one request at a time.

## `timeoutSecs` (type: `integer`):

5-60, default 15. A timeout is reported as BROKEN and is not charged.

## Actor input object example

```json
{
  "mappings": [
    {
      "oldUrl": "https://tools.plainwrenstudio.com/bots",
      "expectedUrl": "https://tools.plainwrenstudio.com/bots/",
      "expectedStatus": 308
    }
  ],
  "expectedStatus": 301,
  "maxHops": 5,
  "ignoreTrailingSlash": false,
  "ignoreQuery": false,
  "requestsPerSecond": 2,
  "maxConcurrency": 4,
  "timeoutSecs": 15
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset of checked (or failed) redirect-map rows.

## `OUTPUT` (type: `string`):

Compact run totals for the Console.

## `SUMMARY` (type: `string`):

Full run summary, including counts per result.

## `REPORT_html` (type: `string`):

Human-readable HTML report.

## `REPORT_csv` (type: `string`):

CSV of every result row.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mappings": [
        {
            "oldUrl": "https://tools.plainwrenstudio.com/bots",
            "expectedUrl": "https://tools.plainwrenstudio.com/bots/",
            "expectedStatus": 308
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("plainwren/redirect-map-tester").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "mappings": [{
            "oldUrl": "https://tools.plainwrenstudio.com/bots",
            "expectedUrl": "https://tools.plainwrenstudio.com/bots/",
            "expectedStatus": 308,
        }] }

# Run the Actor and wait for it to finish
run = client.actor("plainwren/redirect-map-tester").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mappings": [
    {
      "oldUrl": "https://tools.plainwrenstudio.com/bots",
      "expectedUrl": "https://tools.plainwrenstudio.com/bots/",
      "expectedStatus": 308
    }
  ]
}' |
apify call plainwren/redirect-map-tester --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,plainwren/redirect-map-tester"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/7lLrDt6qjfgcojmHZ/builds/PPPjfpgweXsZtrY3v/openapi.json
