# Redirect Map Generator – 301 Redirects for Site Migration (`rowfeed/redirect-map-generator`) Actor

Moving to a new domain? Every old URL (Internet Archive + backlinks) mapped to the best page on the new site, sorted by link value, with a ready .htaccess, nginx config and CSV. Shows which old pages with backlinks are broken now.

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

## Pricing

from $2.00 / 1,000 old url mappeds

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

## Redirect Map Generator – 301 Redirects for Site Migration

Moving a website to a new domain, or buying an old domain to point at your site? Lost 301 redirects are the most common way to lose rankings and backlink value in a migration. This tool finds every old URL and maps it to the best page on the new site, in one run.

- **Every old URL:** pages the Internet Archive has saved for the old domain and its subdomains, plus every old page other sites still link to.
- **Link value first:** each old URL shows how many sites link to it and the strongest one, so you fix what matters first.
- **Best new page:** same path first, then the closest page by URL words and page titles (works in any language, also with æøå and accents). Pages with no good match go to your fallback page instead of a wrong one.
- **Status now:** each old URL is requested now (200, 301, 404 or dead), so you see which backlinks are leaking today.
- **Ready to paste:** a `.htaccess` (Apache / LiteSpeed), an nginx config and a CSV for Netlify, Vercel, Shopify, Webflow or WordPress redirect plugins. One hop, query strings dropped, domain verification files left alone, catch-all last.

Built for site migrations and redesigns, domain changes and rebrands, platform switches (WordPress to Webflow, Shopify and others), merging sites, and SEOs who buy expired domains for their backlinks.

### Example output row

```json
{"old_url": "https://haugesund-aerobic.no/kontakt-oss", "new_url": "https://gardfysikalske.no/kontakt", "match": "slug", "confidence": 0.99, "referring_domains": 1, "best_linking_domain": "www.norskkundeservice.com", "current_status": "301"}
```

The `.htaccess` file:

```apache
RewriteEngine On
RewriteRule ^\.well-known/ - [L]
RewriteCond %{HTTP_HOST} ^(www\.)?haugesund\-aerobic\.no$ [NC]
RewriteRule ^kontakt-oss/?$ https://gardfysikalske.no/kontakt? [R=301,L,NC]
RewriteRule ^$ https://gardfysikalske.no/? [R=301,L]
RewriteRule ^ https://gardfysikalske.no/? [R=301,L]
```

Download `htaccess.txt`, `nginx.conf` and `redirects.csv` from the run's Storage tab (key-value store) or through the API.

### How to use

1. Click **Try for free** (or **Start**) at the top of this page to open the input form.
2. Fill in **Old domain**. The domain you are moving away from, e.g. old-site.com. The form comes with a working example, so you can also run it as it is.
3. Optional: adjust **New domain**, **Include subdomains of the old domain**, **Fallback page**, **Check old URLs now**. Every field has a sensible default.
4. Click **Start** and wait for the run to finish.
5. Download the results as Excel, CSV or JSON from the **Output** tab, or get them through the Apify API, a schedule or an integration (Make, Zapier, Google Sheets ...).

### Pricing

Pay per event, no subscription:

- **$0.50 per domain mapped** (includes the backlink lookup).
- **$0.002 per old URL mapped.**
- $0.002 per run start.

Examples: a site with 100 old URLs costs $0.70. A 1,000-URL migration costs $2.50. An old domain with no archived pages and no backlinks is not charged beyond the start. The pre-filled example is served from a saved run and costs only the start fee.

### Input

| Field | What it does |
|---|---|
| `oldDomain` | The domain you are moving away from. |
| `newDomain` | The domain the old pages should go to. |
| `includeSubdomains` | Also map blog., shop., event. and other subdomains (default on). |
| `fallbackUrl` | Where unmatched pages go (default: the new front page). |
| `checkLiveStatus` | Request each old URL now and show its status (default on). |
| `maxOldUrls` | Up to 5,000; pages with backlinks come first. |

### Good to know

- **Live maps need a paid Apify plan** (any plan); the pre-filled example works on the free plan.
- Check the `fallback` rows before you go live: a human often knows the right page (a renamed service, a moved office). Edit the CSV or the rule, and keep the rest.
- The new site's pages come from its sitemap (or the links on its front page if it has none), up to 500 pages.
- Old URLs come from the Internet Archive and from backlink data (via DataForSEO). Pages that were never archived and have no backlinks cannot be found.
- Not affiliated with the Internet Archive.

### More tools from Rowfeed

- [Redirect Checker](https://apify.com/rowfeed/redirect-checker) – check that every redirect works after you go live.
- [Backlinks Checker](https://apify.com/rowfeed/backlink-checker) – every site that links to a domain or page.
- [Wayback Machine Scraper](https://apify.com/rowfeed/wayback-internet-archive-scraper) – archived snapshots of any URL.
- [Sitemap URL Extractor](https://apify.com/rowfeed/sitemap-url-extractor) – every URL of the new site from its sitemaps.
- [Domain History Checker](https://apify.com/rowfeed/domain-history-checker) – backlinks and strength of any domain every month since 2019.

# Actor input Schema

## `oldDomain` (type: `string`):

The domain you are moving away from, e.g. old-site.com.

## `newDomain` (type: `string`):

The domain the old pages should go to, e.g. new-site.com.

## `includeSubdomains` (type: `boolean`):

blog., shop., event. and so on.

## `fallbackUrl` (type: `string`):

Where old pages with no match go. Empty = the new front page. A full URL or a path like /services.

## `checkLiveStatus` (type: `boolean`):

Request every old URL and show its current status (200, 301, 404 or dead), so you see which links are leaking right now.

## `maxOldUrls` (type: `integer`):

Pages with backlinks come first.

## Actor input object example

```json
{
  "oldDomain": "haugesund-aerobic.no",
  "newDomain": "gardfysikalske.no",
  "includeSubdomains": true,
  "checkLiveStatus": true,
  "maxOldUrls": 2000
}
```

# Actor output Schema

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

No description

## `htaccess` (type: `string`):

No description

## `nginx` (type: `string`):

No description

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

No description

# 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 = {
    "oldDomain": "haugesund-aerobic.no",
    "newDomain": "gardfysikalske.no"
};

// Run the Actor and wait for it to finish
const run = await client.actor("rowfeed/redirect-map-generator").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 = {
    "oldDomain": "haugesund-aerobic.no",
    "newDomain": "gardfysikalske.no",
}

# Run the Actor and wait for it to finish
run = client.actor("rowfeed/redirect-map-generator").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 '{
  "oldDomain": "haugesund-aerobic.no",
  "newDomain": "gardfysikalske.no"
}' |
apify call rowfeed/redirect-map-generator --silent --output-dataset

```

## MCP server setup

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

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/61KOgwlTFvr6Rfotd/builds/iAgGjDurHRNU2Qd2i/openapi.json
