# Redirect Chain Checker: Bulk HTTP Status & 301 Redirect Map (`dottti/redirect-chain-checker`) Actor

Check thousands of addresses at once: every redirect hop with its status (301, 302, 307, 308), final address and status, redirect loops, https to http downgrades, meta refresh, and whether each old address lands on the expected new one. Built for site migrations.

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

## Pricing

from $0.35 / 1,000 address checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Redirect Chain Checker: Bulk HTTP Status & 301 Redirect Map

Paste a list of addresses, or a redirect map of old and new addresses. For each one you get every redirect hop with its status code, the final address and status, a plain verdict, and a list of issues: chains that are too long, temporary redirects where permanent ones are usual, https to http downgrades, loops, meta refresh redirects, and old addresses that do not land on the new one you expected.

### Who it is for

- **SEO teams and agencies running a site migration**: check the whole redirect map before and after launch.
- **Marketers** checking campaign, affiliate and short links before they go out.
- **Developers** checking http to https and www to non-www rules after a server change.

### Input

One address per line. To check a redirect map, add the expected target after the old address:

```
old-site/page-a -> new-site/page-a
old-site/page-b | new-site/page-b
```

A tab, or a comma between two full addresses, also works. Lines without a scheme are checked over https; write http:// in front to test the http to https redirect.

### What each row tells you

| Field | Meaning |
|---|---|
| `verdict` | `ok` (works, no redirect), `redirected` (works after redirects), `broken` (4xx, dead domain, loop, too many redirects), `server_error` (5xx), `unreachable` (timeout, refused, failed secure connection), `blocked` (access check, not verified), `not_checked` (robots.txt closes the address to us) |
| `finalStatus`, `finalUrl` | Where the address ends up and the answer there |
| `redirectCount`, `redirectTypes` | Number of redirects and their codes, for example "301 > 302" |
| `chain` | Every hop: step, address, status, type (permanent, temporary, final) and response time |
| `allPermanent` | True when every redirect is 301 or 308 |
| `matchesExpected` | With an expected target: true when the chain ends there and that page works |
| `httpsDowngrade`, `hostChanged`, `domainChanged` | Flags for security and migration checks |
| `metaRefreshTo` | Target of a meta refresh tag on the final page, if any |
| `issues` | Plain-language list of what to fix |

### Example (real run, addresses shortened)

```json
{
  "recordType": "url",
  "url": "(old http address of a programming language site)",
  "expectedUrl": "(its new documentation address)",
  "verdict": "redirected",
  "reason": "works after 2 redirect(s)",
  "matchesExpected": true,
  "finalStatus": 200,
  "redirectCount": 2,
  "redirectTypes": "302 > 301",
  "allPermanent": false,
  "httpsDowngrade": false,
  "hostChanged": true,
  "domainChanged": true,
  "issues": [
    "2 redirects in a row; one direct redirect is best",
    "a temporary redirect (302, 303 or 307) is used; moved pages usually use 301 or 308"
  ],
  "charged": true
}
```

### Pricing

You pay per address checked that gave a definite answer (works, redirected, broken, server error or unreachable). Addresses that robots.txt closes to us and addresses that answer with an access check are free, because they could not be verified. Bad input lines are free.

Platform usage is included in the price.

### How it behaves

- Each hop is requested by hand, so every status and Location header is recorded. Before every hop the actor reads that host's robots.txt and obeys it for its own name, `dottti-redirect-chain-checker`.
- Requests to one host go out one at a time with a delay (300 ms by default), so a big map on one site takes a while: about 3 addresses per second per host. Different hosts run in parallel.
- No proxy, no cookies, no browser. Firewall or bot-check answers are reported as `blocked` and never bypassed.

### Limits

- Redirects made by JavaScript are not followed. Meta refresh tags are detected on the final page and reported, not followed further.
- Each address is requested once. A server that is briefly down shows as `server_error` or `unreachable`; run again to confirm.
- Some sites send different redirects to different countries, devices or logged-in visitors. You see what a visitor without cookies gets from the Apify servers.
- Addresses with a user name or password, and private or local network addresses, are not checked.

# Actor input Schema

## `urls` (type: `array`):

One address per line. To check a redirect map, add the expected new address after it: old -> new (also accepted: old | new, a tab, or a comma between two full addresses). Lines without a scheme are checked over https; type http:// to test the http to https redirect. Empty = a demo with three addresses.

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

Stop after this many redirects and report the chain as too long.

## `checkMetaRefresh` (type: `boolean`):

When the final page is HTML, look for a meta refresh tag that sends visitors on, and report its target (it is then used for the expected-target match).

## `strictMatch` (type: `boolean`):

Off = the final address matches the expected one when host, path and query are the same (scheme, host case and a trailing slash are ignored). On = the addresses must be identical.

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

How many addresses are checked in parallel. Requests to any single host are always sent one at a time with the delay below.

## `requestDelayMs` (type: `integer`):

Minimum gap between two requests to the same host.

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

An address that does not answer in this time is reported as unreachable.

## Actor input object example

```json
{
  "urls": [
    "http://python.org/ -> https://www.python.org/",
    "http://www.nodejs.org/",
    "http://golang.org/doc/ -> https://go.dev/doc/"
  ],
  "maxHops": 10,
  "checkMetaRefresh": true,
  "strictMatch": false,
  "maxConcurrency": 5,
  "requestDelayMs": 300,
  "timeoutSecs": 20
}
```

# Actor output Schema

## `results` (type: `string`):

One row per address checked, plus free status rows.

# 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 = {
    "urls": [
        "http://python.org/ -> https://www.python.org/",
        "http://www.nodejs.org/",
        "http://golang.org/doc/ -> https://go.dev/doc/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("dottti/redirect-chain-checker").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 = { "urls": [
        "http://python.org/ -> https://www.python.org/",
        "http://www.nodejs.org/",
        "http://golang.org/doc/ -> https://go.dev/doc/",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("dottti/redirect-chain-checker").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 '{
  "urls": [
    "http://python.org/ -> https://www.python.org/",
    "http://www.nodejs.org/",
    "http://golang.org/doc/ -> https://go.dev/doc/"
  ]
}' |
apify call dottti/redirect-chain-checker --silent --output-dataset

```

## MCP server setup

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

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/J39fDQM79gUZrP9fg/builds/Nn1d0UnusfZPpIyaa/openapi.json
