# Website Migration Redirect & Canonical Audit (`kirozhang/website-migration-redirect-audit`) Actor

Validate old-to-new URL mappings after a site migration. Find wrong destinations, redirect chains, noindex and canonical mismatches with HTTP evidence.

- **URL**: https://apify.com/kirozhang/website-migration-redirect-audit.md
- **Developed by:** [Kiro Zhang](https://apify.com/kirozhang) (community)
- **Categories:** SEO tools, Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 url mapping audits

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

## Website Migration Redirect & Canonical Audit

Check the redirects you actually intended to deploy. Give the Actor old URLs and their expected destinations to produce a migration acceptance report for an agency, SEO team or website owner.

### Who this is for

For SEO consultants and agencies checking a migration release or retesting critical landing pages after deployment. Supply the intended destination to distinguish a working redirect from the correct redirect.

Start with at most 10 result rows: the Actor event charges for that batch are at most $0.1 at the listed rate. Set both `maxResults` and the run's maximum charge before starting.

### Quick start

Open the Input tab, paste your input and run. A small example:

```json
{
  "mappings": [
    {
      "url": "http://www.wikipedia.org/",
      "expectedUrl": "https://www.wikipedia.org/"
    },
    {
      "url": "https://example.com/",
      "expectedUrl": "https://example.com/"
    }
  ],
  "maxResults": 10
}
```

### Checks and output

Each row contains the observed HTTP chain, final URL and status, canonical URL, robots directives, page title, issues and a `passed` flag. Checks include destination mismatch, missing redirect, temporary redirect, multiple hops, loops, HTTP errors, HTTPS downgrade, noindex, canonical mismatch, meta refresh and a possible soft 404 based on the page title.

`passed: true` means none of these implemented checks found a problem. It is not a guarantee of search indexing or preserved rankings. A valid 404 or a detected redirect loop is a completed, billable audit result because it answers the migration question. Authentication refusals, robots blocks, rate limits and network failures are reported separately and do not create paid rows.

### Preparing your mapping list

Use one object per old URL. Include `expectedUrl` to verify an exact destination. Omit it to inspect only HTTP and HTML problems. The comparison preserves trailing slashes and query strings; URL fragments are removed. The same input object is processed once per run. Start with a small batch before checking a complete migration.

### Scope and limitations

Only HTTP redirects and the returned server HTML are inspected, with at most ten redirects. JavaScript redirects, rendered pages, sitemaps and search-engine indexing are outside the scope. A legitimate 302 will still be flagged for human review. Private addresses, embedded credentials and unusual ports are refused. Robots rules are respected, including on redirect targets.

### Pricing and limits

$10 per 1,000 delivered URL mapping audit results ($0.01 each). There is no Actor startup fee. Standard platform usage is included in this Actor's event price. A successfully delivered dataset row triggers one charge; error diagnostics live in `RUN_SUMMARY` and are not chargeable rows. Repeated runs are new checks and may return the same item again. The Pricing tab is authoritative.

Use the run's maximum charge setting and `maxResults` to control spending. No proxy subscription or external API key is required. Runs use 256 MB by default. For large batches, raise the run timeout or split the input; a hard timeout may leave an incomplete dataset. The presence of a finished `RUN_SUMMARY` helps distinguish completed processing from interrupted runs.

### Export and integrations

Use the Output tab to inspect results and the summary. Download JSON, CSV or Excel from the dataset, or use Apify's API, Make, Zapier or n8n to pass the output into your existing workflow. Nested evidence is most faithfully preserved in JSON. The default dataset belongs to the run; no external destination receives results automatically.

An API client can start `kirozhang/website-migration-redirect-audit` with the JSON above, wait for completion and read its default dataset. Set your Apify token in the client's credential store, never inside the input URLs.

### Troubleshooting

Read `RUN_SUMMARY.errors` and `limitReasons` first. A partial run may contain useful rows; it must not be treated as exhaustive. All-target failure marks the run failed. A valid search with no matches can succeed with zero rows. For support, open an Issue on this Actor with the run ID, expected behavior and a public example target. Remove credentials and private data from your report.

### Example output

Illustrative excerpt from a real verification run; values change over time.

```json
{
  "url": "https://example.com/",
  "expectedUrl": "https://example.com/",
  "finalUrl": "https://example.com/",
  "finalStatus": 200,
  "redirectCount": 0,
  "passed": true,
  "issues": []
}
```

### Workflows and questions

#### Migration launch and weekly regression checks

1. Take the old URL and approved new URL from your migration sheet and create one `mappings` object per pair.
2. Run a small representative batch before launch acceptance. Filter rows with `passed: false`; inspect `issues` and the HTTP chain.
3. After fixing a redirect, run the same mapping again. Save dated datasets as evidence of the change.
4. Keep a smaller task for your highest-value landing pages after each release. A successful check is evidence about the observed HTTP response, not a ranking forecast.

#### Common questions

**Does a 200 response mean the migration passed?** No. The final URL can still be wrong, blocked by `noindex`, or inconsistent with the canonical.

**Will it find all old URLs automatically?** No. Bring your mapping list. Sitemap crawling and JavaScript redirects are outside this Actor's scope.

**Why is a 404 billable?** A confirmed 404 is a completed audit answer. Network failures, authentication refusals and robots blocks are reported without paid result rows.

### API quick start

Save the Quick start JSON as `input.json`. Put your Apify token in the `APIFY_TOKEN` environment variable through your usual secret store, then run:

```bash
curl --fail-with-body --max-time 200 \
  --request POST \
  --header "Authorization: Bearer $APIFY_TOKEN" \
  --header "Content-Type: application/json" \
  --data-binary @input.json \
  "https://api.apify.com/v2/acts/kirozhang~website-migration-redirect-audit/run-sync-get-dataset-items?timeout=180&memory=256&maxTotalChargeUsd=0.10&format=json&clean=true" \
  --output results.json
```

This example starts a real run and applies a $0.10 charge ceiling. The smaller `maxResults` cap still applies. An empty array can be a valid no-match result; inspect the run and `RUN_SUMMARY` in Console. If the connection times out, check Console before retrying, since the run may already exist. For larger exports, use the asynchronous API shown on this Actor's API tab and read the dataset after the run finishes.

### Scheduling and workflow tools

After a successful small run, save a task with your production input. [Apify schedules](https://docs.apify.com/actors/running/schedules) can run that task regularly. In Make, Zapier or n8n, store the token in the connection credentials, run this Actor, wait for completion, and read its dataset. Configure your own destination explicitly; this Actor does not send emails or post messages automatically. Each scheduled run may incur charges, including repeated results.

### Related tools for different steps

- [Inventory the CMS and framework before a migration with the Website Technology Detector.](https://apify.com/kirozhang/website-tech-stack-evidence)
- [When a domain move also changes mail configuration, review the public records with the Email DNS Audit.](https://apify.com/kirozhang/email-dns-auth-audit)

# Actor input Schema

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

Up to 1,000 objects with url and an optional expectedUrl. Exact final URL comparison includes trailing slashes and query strings; fragments are ignored.

## `maxResults` (type: `integer`):

Additional global cap for this run. Stops before another paid result is saved. The lower of this value, product-specific caps and your charge budget applies.

## Actor input object example

```json
{
  "mappings": [
    {
      "url": "http://www.wikipedia.org/",
      "expectedUrl": "https://www.wikipedia.org/"
    }
  ],
  "maxResults": 500
}
```

# Actor output Schema

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

Delivered rows, exportable as JSON, CSV or Excel.

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

Counts, limits and unbilled errors. Check complete before treating the result as exhaustive.

# 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": [
        {
            "url": "http://www.wikipedia.org/",
            "expectedUrl": "https://www.wikipedia.org/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kirozhang/website-migration-redirect-audit").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": [{
            "url": "http://www.wikipedia.org/",
            "expectedUrl": "https://www.wikipedia.org/",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("kirozhang/website-migration-redirect-audit").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": [
    {
      "url": "http://www.wikipedia.org/",
      "expectedUrl": "https://www.wikipedia.org/"
    }
  ]
}' |
apify call kirozhang/website-migration-redirect-audit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kirozhang/website-migration-redirect-audit"
        }
    }
}
```

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/xIzBZNeqkPTi6NzfL/builds/vzcs93NagJrQkdc4b/openapi.json
