# Redirect Migration Auditor (`junipr/redirect-migration-auditor`) Actor

Validate old-to-new URL redirects, migration maps, chains, loops, and incorrect destination patterns.

- **URL**: https://apify.com/junipr/redirect-migration-auditor.md
- **Developed by:** [junipr](https://apify.com/junipr) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.90 / 1,000 page auditeds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Redirect Migration Auditor

### Store Positioning

**Store title:** Redirect Migration Auditor

**Short description:** Validate old-to-new URL redirects, migration maps, chains, loops, and incorrect destination patterns.

**SEO title:** Redirect Migration Auditor — technical SEO, web, and domain audit

**SEO description:** Validate old-to-new URL redirects, migration maps, chains, loops, and incorrect destination patterns. Use it to find crawlability, indexability, security, metadata, and page-quality issues with evidence-backed rows and audit reports.

**Categories:** SEO\_TOOLS

**Keywords:** redirect, migration, auditor, web/domain audit

### Fixed-Inclusive PPE Pricing

This actor uses pay-per-event pricing. Event prices include Apify platform usage; users are not expected to pay a separate platform-usage pass-through charge for the configured pricing model.

- Tier: W1 — Web/domain audit
- Primary event: `page-audited` at $0.00490 base
- Default max charge: $10.00
- Store discounts: FREE/BRONZE base, SILVER discounted, GOLD deepest approved discount

Event set:

- `actor-start`: base $0.00500, GOLD $0.00400. Redirect Migration Auditor: charged when actor start is completed. The price includes Apify platform usage; no separate usage pass-through is intended.
- `page-audited`: base $0.00490, GOLD $0.00392. Redirect Migration Auditor: charged when page audited is completed. The price includes Apify platform usage; no separate usage pass-through is intended.
- `record-extracted`: base $0.00372, GOLD $0.00298. Redirect Migration Auditor: charged when record extracted is completed. The price includes Apify platform usage; no separate usage pass-through is intended.
- `finding-emitted`: base $0.00372, GOLD $0.00298. Redirect Migration Auditor: charged when finding emitted is completed. The price includes Apify platform usage; no separate usage pass-through is intended.
- `audit-report-generated`: base $0.05000, GOLD $0.04000. Redirect Migration Auditor: charged when audit report generated is completed. The price includes Apify platform usage; no separate usage pass-through is intended.

### Public Task Concepts

- Audit Redirect Migration controls on a capped public page set
- Find high-priority Redirect Migration issues before release
- Validate Redirect Migration evidence from supplied pages
- Prioritize Redirect Migration fixes with severity and proof
- Export Redirect Migration QA rows for client review

Validate old-to-new URL redirects, migration maps, chains, loops, and incorrect destination patterns.

### What This Actor Does

Redirect Migration Auditor verifies old URLs against expected destinations. It can probe live HTTP redirects hop by hop with manual redirect handling, or analyze supplied migration snapshots without network access. Each dataset row includes first and terminal status, the full redirect chain, loop detection, destination matching, severity, and a concrete remediation.

Use it before or after a site migration to find missing redirects, temporary redirects, long chains, loops, incorrect destinations, and broken terminal pages. The default two-row input is capped and network-free; live probing is explicit through `fetchUrls`.

### What This Actor Does Not Do

- It does not provide legal, medical, financial, investment, safety, or compliance advice.
- It does not guarantee completeness of any public source or third-party dataset.
- It does not collect sensitive personal data by default.
- It does not rely on unsupported private APIs.
- It does not bypass authentication, robots controls, or access restrictions.

### Best Use Cases

- site migration redirect QA
- redirect-chain cleanup
- old-to-new URL map validation

### Input Fields Explained

| Field | Type | Default | Notes |
| --- | --- | --- | --- |
| `records` | array | built-in records | Migration rows with `oldUrl`, optional `expectedUrl`, observed status, final URL, and redirect-chain metadata. |
| `urls` | array | \[] | Old URLs to probe. Explicit URLs take precedence over schema-populated default records. |
| `fetchUrls` | boolean | false | Follows each supplied URL manually and records every redirect hop. |
| `fetchTimeoutMs` | integer | 12000 | Timeout per HTTP request, capped at 30 seconds. |
| `maxRedirects` | integer | 6 | Maximum redirect hops, capped at 10. |
| `watchTerms` | array | actor defaults | Terms used to mark relevant records and alerts. |
| `includeReport` | boolean | true | Writes JSON and Markdown report artifacts to the key-value store. |
| `maxItems` | integer | 2 | Caps processed records. Maximum is 50. |
| `maxTextBytes` | integer | 500000 | Caps analyzed text per record. |
| `debug` | boolean | false | Enables debug logging. |

### Example Input

```json
{
  "records": [
    {
      "sourceId": "redirect-good",
      "sourceUrl": "https://old.example/page-a",
      "title": "Old page A redirects to new page A",
      "description": "301 redirect to the expected destination.",
      "category": "redirect",
      "keywords": [
        "301"
      ],
      "metadata": {
        "oldUrl": "https://old.example/page-a",
        "expectedUrl": "https://new.example/page-a",
        "finalUrl": "https://new.example/page-a",
        "statusCode": 301,
        "chainLength": 1
      }
    },
    {
      "sourceId": "redirect-loop",
      "sourceUrl": "https://old.example/loop",
      "title": "Looping migration redirect",
      "description": "302 temporary redirect enters a loop cycle.",
      "category": "redirect",
      "keywords": [
        "302",
        "loop"
      ],
      "metadata": {
        "oldUrl": "https://old.example/loop",
        "finalUrl": "https://old.example/loop",
        "statusCode": 302,
        "chainLength": 6,
        "loop": true
      }
    }
  ],
  "includeReport": true,
  "maxItems": 2
}
```

### Output Fields Explained

| Field | Meaning |
| --- | --- |
| `auditId` | Stable hash for the checked record. |
| `sourceId`, `sourceUrl` | Source identifiers for traceability. |
| `status`, `severity`, `score` | Normalized outcome and 0-100 quality/risk score. |
| `matchedKeywords` | Watch terms found in the record text or metadata. |
| `issues`, `issueCodes` | Actor-specific findings with severity and messages. |
| `recommendations` | Next actions for the operator or content/data owner. |
| `metadata` | Original metadata plus derived helper fields when applicable. |
| `pricingTemplate`, `pricingEventName` | PPE tier and primary billed event. |

### Example Output

```json
{
  "auditId": "redirect_1493e1978fcc5618",
  "actorSlug": "redirect-migration-auditor",
  "actorName": "Redirect Migration Auditor",
  "sourceType": "input",
  "sourceId": "redirect-good",
  "sourceUrl": "https://old.example/page-a",
  "title": "Old page A redirects to new page A",
  "status": "pass",
  "severity": "none",
  "score": 100,
  "matchedKeywords": [
    "301"
  ],
  "primaryEntity": null,
  "category": "redirect",
  "publishedAt": null,
  "summary": "301 redirect to the expected destination.",
  "issueCount": 0,
  "issues": [],
  "issueCodes": [],
  "recommendations": [
    "Redirect Migration Auditor did not find immediate risk signals for this record. Re-run after source data changes."
  ],
  "metadata": {
    "oldUrl": "https://old.example/page-a",
    "expectedUrl": "https://new.example/page-a",
    "finalUrl": "https://new.example/page-a",
    "statusCode": 301,
    "chainLength": 1,
    "sourceSpecific": {
      "redirectRows": [
        {
          "oldUrl": "https://old.example/page-a",
          "expectedUrl": "https://new.example/page-a",
          "finalUrl": "https://new.example/page-a",
          "firstStatusCode": 301,
          "terminalStatusCode": null,
          "redirectCount": 1,
          "redirectChain": [
            {
              "url": "https://old.example/page-a",
              "status": 301
            }
          ],
          "loop": false,
          "destinationMatches": true,
          "fetchError": null
        }
      ]
    },
    "normalizedTextPreview": "redirect-good https://old.example/page-a Old page A redirects to new page A 301 redirect to the expected destination.   redirect 301 {\"oldUrl\":\"https://old.example/page-a\",\"expectedUrl\":\"https://new.example/page-a\",\"finalUrl\":\"https://new.e"
  },
  "textBytes": 288,
  "checkedAt": "2026-07-02T00:00:00.000Z",
  "pricingTemplate": "W1 — Web/domain audit",
  "pricingEventName": "page-audited"
}
```

### Cost-Control Tips

- Keep `maxItems` small for default and scheduled checks.
- Use supplied records or snapshots for deterministic QA runs.
- Leave `fetchUrls` off unless live source fetching is explicitly needed.
- Review warning rows before increasing caps.
- Schedule small frequent runs instead of broad one-off sweeps.

### Scheduling Examples

- Daily watchlist check with two to five high-value records.
- Weekly QA run before publishing a site, data, or actor update.
- Post-migration checks against a fixed old-to-new URL map.

### Public Task Examples

- Audit a capped old-to-new redirect map before launch.
- Probe high-priority legacy URLs and verify their final destinations.
- Find temporary redirects and multi-hop chains after migration.
- Validate supplied redirect evidence for a client QA report.
- Monitor a small set of revenue-critical legacy URLs on a schedule.

### FAQ

#### Can I use this with live URLs?

Yes. Put the old URLs in `urls` and set `fetchUrls` to `true`. The actor uses manual redirect handling so the chain is preserved instead of silently following to the end.

#### Why does it charge before pushing output?

Pay-per-event actors charge before paid output is written. If the run charge cap cannot cover another row, processing stops without emitting unpaid data.

#### What happens on charge limits?

The actor stops gracefully and writes a summary instead of pushing unpaid result rows.

#### Is this legal, financial, safety, or compliance advice?

No. The actor produces operational signals and structured data for review. Human owners remain responsible for decisions.

### Troubleshooting

- If the dataset is empty, check that `maxItems` is greater than zero and that records are supplied or defaults are enabled.
- If a record is flagged unexpectedly, inspect `issueCodes`, `matchedKeywords`, and the normalized metadata preview.
- If live fetching fails, rerun with supplied record bodies or snapshots and keep `fetchUrls` false.

### Limitations

Live probing uses standard HTTP `HEAD` requests with a `GET` fallback for servers that reject `HEAD`. Results can differ for authenticated, geolocated, JavaScript-only, or bot-protected routes. Destination matching is exact after URL normalization; review intentional query-string differences separately.

### Source And Safety Notes

Use public or permissioned URLs and keep batches capped. Do not place credentials, private URLs, or sensitive personal data in inputs.

### Changelog

- 2026-07-10: Added real redirect-chain probing, destination validation, loop/error diagnostics, and expanded regression coverage.

# Actor input Schema

## `records` (type: `array`):

Records, snapshots, or source observations to process. Defaults to a tiny deterministic fixture.

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

Optional URLs reserved for live fetching when Fetch URLs is true.

## `fetchUrls` (type: `boolean`):

Fetch sourceUrl text over HTTP. Default is false for deterministic local runs.

## `fetchTimeoutMs` (type: `integer`):

Timeout for each redirect hop request.

## `maxRedirects` (type: `integer`):

Maximum redirect hops followed before emitting a capped diagnostic.

## `watchTerms` (type: `array`):

Keywords or topics used to flag relevant records.

## `includeReport` (type: `boolean`):

Write JSON and Markdown report artifacts to the key-value store.

## `maxItems` (type: `integer`):

Maximum records to process in one run.

## `maxTextBytes` (type: `integer`):

Maximum searchable text bytes per record.

## `dryRun` (type: `boolean`):

Validate input and write a dry-run summary without PPE charges or dataset output.

## `debug` (type: `boolean`):

Enable debug logging.

## Actor input object example

```json
{
  "records": [
    {
      "sourceId": "redirect-good",
      "sourceUrl": "https://old.example/page-a",
      "title": "Old page A redirects to new page A",
      "description": "301 redirect to the expected destination.",
      "category": "redirect",
      "keywords": [
        "301"
      ],
      "metadata": {
        "oldUrl": "https://old.example/page-a",
        "expectedUrl": "https://new.example/page-a",
        "finalUrl": "https://new.example/page-a",
        "statusCode": 301,
        "chainLength": 1
      }
    },
    {
      "sourceId": "redirect-loop",
      "sourceUrl": "https://old.example/loop",
      "title": "Looping migration redirect",
      "description": "302 temporary redirect enters a loop cycle.",
      "category": "redirect",
      "keywords": [
        "302",
        "loop"
      ],
      "metadata": {
        "oldUrl": "https://old.example/loop",
        "finalUrl": "https://old.example/loop",
        "statusCode": 302,
        "chainLength": 6,
        "loop": true
      }
    }
  ],
  "urls": [],
  "fetchUrls": false,
  "fetchTimeoutMs": 12000,
  "maxRedirects": 6,
  "watchTerms": [
    "301",
    "302",
    "loop",
    "wrong destination"
  ],
  "includeReport": true,
  "maxItems": 2,
  "maxTextBytes": 500000,
  "dryRun": false,
  "debug": false
}
```

# Actor output Schema

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

Structured result rows in the default dataset.

## `summary` (type: `string`):

Summary JSON in the key-value store when includeReport is enabled.

## `markdownReport` (type: `string`):

Markdown report in the key-value store when includeReport is enabled.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("junipr/redirect-migration-auditor").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("junipr/redirect-migration-auditor").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{}' |
apify call junipr/redirect-migration-auditor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=junipr/redirect-migration-auditor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/fZWYyZRHvWyYPNzXk/builds/hNLLika3M3E1gegD7/openapi.json
