Prompt

7 minute read

Redirect Mapping Prompt: Match Old URLs to New Pages

A reusable redirect mapping prompt that pairs each old URL with the best new page before a migration, explains every match and refuses blanket home page redirects.

Abstract illustration for Redirect Mapping Prompt: Match Old URLs to New Pages

This redirect mapping prompt matches the URLs of an old site to the best page on the new site before a migration. It pairs each old URL with one new URL, explains the match and marks URLs that have no good destination. You then review the map, test it and load it into your server or CMS as 301 redirects.

The page explains each variable, gives the full prompt and shows one real run on invented URLs. It also lists the checks that prevent redirect chains and mass redirects to the home page. Google recommends permanent server-side redirects whenever a URL changes, so a careful map helps search engines and visitors follow every old URL.

What this redirect mapping prompt does

The prompt compares old and new pages by title and purpose, not just by similar words in the URL. For each old URL it proposes the single closest new page and gives a confidence level and a reason.

When no new page serves the same purpose, it says so instead of sending the URL to the home page. Those URLs then get a decision from you: create a page, redirect to a close parent, or let them return 404 or 410.

When to use it

Use it before a domain change, a CMS migration or a restructure that changes URLs. It suits lists of up to a few hundred URLs per run.

  • Moving a blog from one platform to another with new URL patterns.
  • Merging two sections or two sites into one.
  • Cleaning up old campaign pages that now return 404.

However, if old and new URLs follow a clear pattern, a regular expression rule is faster and safer. Use the prompt for the pages that do not fit any pattern.

Inputs and variables

Replace every bracketed variable before you run the prompt. Titles and short purposes give the model much more to work with than bare URLs.

  • [OLD_URLS]: old URLs with their titles, ideally sorted by traffic or backlinks so the important ones come first.
  • [NEW_URLS]: new URLs with titles and a short purpose for each.
  • [RULES]: any constraints, for example "never redirect to the home page; product URLs keep their SKU".

Export old URLs from your crawler, sitemap or analytics. URL lists are not personal data, but leave out any URLs with customer IDs or tokens.

Reusable prompt — version 1.0

Copy the prompt below as it is. It forbids blanket home page redirects and asks for a reason on every row.

You are helping an SEO specialist plan 301 redirects for a site migration.

<task>
Map each URL in <old> to the single best URL in <new>.
</task>

<rules>
1. Match by the page's purpose and topic, using titles and descriptions, not only URL words.
2. Use only URLs from <new>, copied exactly. Never invent a destination.
3. Never send a URL to the home page just because nothing else fits. Mark it NO MATCH instead.
4. Give each row a confidence level: high, medium or low.
5. Map every old URL directly to its final destination, never to another old URL, so there are no chains.
6. Follow <rules>.
</rules>

<output_format>
Table: old URL | new URL or NO MATCH | confidence | reason
List: NO MATCH URLs with a suggestion (create page, parent page, or 410)
List: low-confidence rows to review first
</output_format>

<rules>[RULES]</rules>
<old>
[OLD_URLS]
</old>
<new>
[NEW_URLS]
</new>

Rule 3 matters most. Google's site move guidance advises against redirecting many old URLs to one irrelevant destination, such as the home page.

How to use it

Any capable chat model can run this redirect mapping prompt. Work in batches so you can check each table properly.

  1. Export old URLs with titles, sorted by traffic or links, and the new URL list.
  2. Fill in the variables, paste the prompt into a new chat and run it.
  3. Review low-confidence and NO MATCH rows first, then spot-check the rest.
  4. Load the approved map into a staging server and test every redirect with a crawler.
  5. After launch, watch Search Console for 404s and redirect errors.

Example input and output

We ran version 1.0 once on Claude Opus 5.5 on November 15, 2026. The URLs are invented for this example; the output is trimmed, and trims are marked with "…".

RULES: never redirect to the home page
OLD_URLS:
/blog/2019/05/flat-tire-repair, How to repair a flat tire
/shop/bottles/steel-750, Steel bottle 750 ml
/news/spring-sale-2021, Spring sale 2021
NEW_URLS:
/guides/fix-a-flat-tire, Fix a flat tire: step-by-step repair guide
/products/steel-bottle, Steel bottle (500 ml and 750 ml sizes)
/guides/adjust-disc-brakes, Adjust disc brakes
| old URL | new URL | confidence | reason |
| /blog/2019/05/flat-tire-repair | /guides/fix-a-flat-tire | high | same repair task |
| /shop/bottles/steel-750 | /products/steel-bottle | high | same product; new page covers the 750 ml size |
| /news/spring-sale-2021 | NO MATCH | — | expired promotion with no current equivalent |

NO MATCH: /news/spring-sale-2021: return 410, or redirect to a current
offers page if you create one.

In this run, the model refused to send the expired sale page to the home page and suggested a 410. That single run is an illustration, not a benchmark.

How to check the output

Test the map before launch; a wrong redirect is harder to spot once it is live.

  • Destinations: every new URL exists, returns 200 and is the canonical version.
  • Intent: each pair serves the same reader task, especially for high-traffic pages.
  • No chains: no old URL points to another URL that redirects again.
  • No blanket redirects: nothing lands on the home page by default.
  • Coverage: every old URL with traffic or backlinks has a decision.

Troubleshooting

These fixes address the bad outputs we see most often.

  • The model invents new URLs: repeat rule 2 and paste fewer URLs per batch.
  • Matches rely on URL words only: add titles and purposes to both lists.
  • Too many NO MATCH rows: check whether the new site lacks pages it should have.
  • Rows go missing in long lists: ask it to count input and output rows and confirm they match.

Limitations

The model sees titles, not full pages or link data, so it can miss a better destination. Therefore, a person who knows both sites must review the important rows. It also cannot configure your server or test live redirects.

Outputs vary by model, version and input. A good map reduces risk during a move, but no prompt can guarantee that rankings stay the same.

Version history

Each version carries a date, so you can tell which prompt produced an older map.

  • 1.0: November 15, 2026. First version, tested once on Claude Opus 5.5.

Frequently asked questions

Quick answers to the questions readers ask most about this topic.

Which AI models does this redirect mapping prompt work with?

Any capable chat model that follows structured instructions, such as current models from OpenAI, Anthropic or Google. We tested it once on Claude Opus 5.5. Test every redirect on staging before launch.

Should I redirect old pages to the home page?

Usually not. Google's site move guidance advises against redirecting many old URLs to one irrelevant destination such as the home page. Use the closest relevant page, or let truly retired pages return 404 or 410.

How many URLs can I map in one run?

Up to about 200 per run works well. For larger sites, use pattern rules for predictable URLs and run the prompt in batches for the rest, starting with pages that have the most traffic or links.

Can the prompt set up the redirects for me?

No. It produces a map for review. Your developer or CMS applies the 301 redirects, and a crawler should test them before and after launch.

Sources

These pages support the redirect guidance and the prompting approach above.

  1. Google Search Central: Redirects and Google Search developers.google.com
  2. Google Search Central: Site moves with URL changes developers.google.com
  3. Anthropic: Claude prompting best practices platform.claude.com