Build a loop-free 301 redirect map

Learning how to build a custom 301 redirect map that avoids loops starts with a simple idea: every redirect is an edge between two URLs, and the migration forms a graph. A spreadsheet can hold the rules, but only a graph makes cycles, orphaned destinations and unintended chains visible. The goal is to preserve the visitor’s journey while search engines consolidate signals around the new page.

Australian businesses often connect a .com.au shop, an .au information site and state campaign pages shared across Sydney, Melbourne, Brisbane and Perth. Australian English spellings such as “organise” can become filenames, while EOFY, Christmas and Boxing Day promotions create URL churn. A deliberate map keeps that complexity from becoming a maze.

Model redirects as a URL graph

Start with a URL inventory, not a list of replacement pages. Record each old address, intended destination, reason for the move and approver. Include aliases such as www and non-www hosts, trailing-slash variants, campaign query strings and legacy paths exposed in advertising, email or old documents. Distinguish historical links from live routes.

The main failure patterns compare as follows:

Pattern Example sequence Likely cause Correct action
Direct cycle /old → /new → /old Two pages point to each other Point the old page to one final URL
Self-cycle /old → /old A rewrite or server rule matches itself Exclude the final destination from the redirect rule
Redirect chain /old → /mid → /final Several migrations were layered Collapse the route into one hop
Healthy move /old → /final → 200 The destination is canonical and direct Retain and monitor the mapping

Treat a destination as final only when it returns 200 OK, has one preferred canonical address and does not redirect under another rule. A destination that redirects to a homepage is responsive but often a weak replacement. Use a specific equivalent page where possible; otherwise explain why the broader destination is the closest valid match. This view exposes problems a URL column can hide.

Define destination and normalisation rules

Not every URL change is permanent. Use 301 when the old resource has genuinely moved and will be retired. Temporary promotions, stock shortages and short-lived campaign destinations are safer as 302 or 307, depending on whether the method should be preserved. Recording the original reason makes later changes easier.

Normalise before matching. Decide whether the preferred host includes www, whether directory-style paths end in a slash and which query parameters carry meaning. Hosts are case-insensitive, but path case can be significant, so /Campaign and /campaign may be separate resources. Percent encoding, repeated slashes, default ports and mixed schemes can also create duplicate requests. Encode one canonical form and apply it consistently across the server, CMS and CDN.

Preserve useful query parameters without blindly forwarding everything. A product identifier or Australian postcode may affect the destination, while campaign tags may be retained for attribution or stripped. Fragments are handled by the browser and never sent in the HTTP request, so they cannot reconstruct a missing server path. Redirects should preserve intent without placing personal data in a shared working file.

Build and test the mapping

Give the map enough structure to last. Useful columns include source URL, destination URL, response code, owner, approval date, expected final status and notes. Keep a change log because redirects often outlive their creators. Group rules by migration, but retain an authoritative graph so a campaign rule cannot interfere with unrelated routes.

Test every route before publishing it. A safe permanent move shows 301 followed by 200, with no repeated address and no intermediary hop. curl -I reveals a single response, while curl -IL --max-redirs 10 exposes the chain. Crawl internal links and alias variants, including paths affected by mobile, language or consent settings.

Use staging that mirrors production. Automated tests should fail when a source reaches itself, returns to an earlier URL, ends on another redirect or lands on an unexpected 404. Include high-traffic legacy pages, not only new campaign links. This catches conflicts when a CMS plugin, CDN function and server rule process the same request. For recurring edge cases, use the support guidance to record questions and review requests before release.

Deploy the map in a safe order

Publish final destinations before activating redirects. If /collections/summer moves to /collections/summer-2025, make sure the latter is live first; then connect the former to it. This short window prevents crawlers, visitors and payment integrations from hitting a dead end. Where launch and redirect coincide, test from multiple Australian networks at different times.

Apply rules through one controlled source where possible. A CMS rule, .htaccess directive, JavaScript redirect and edge function can work alone but conflict together. Server-side responses are generally easier for crawlers and monitoring tools to interpret. Remove superseded rules instead of adding layers, since many chains begin with an old rule and end with one nobody remembers.

Keep an immediate rollback path. If traffic, conversions or support contacts fall unexpectedly, disable the newest batch while leaving destination pages intact. Save the exact configuration and validation results with the release record. A staged deployment lets you compare response codes, redirect time and server errors without changing the live customer journey.

Use a focused deployment and review checklist

A compact checklist keeps technical work consistent while leaving room for judgement. Separate checks that happen before release from those that happen after it.

Before deployment

After release

Document decisions that cannot be automated. An old Canberra event page might reasonably point to a national events page when no local equivalent exists, whereas a Brisbane service page should remain geographically specific. Do not redirect by IP merely because a visitor is in Perth; people travel, VPNs are common and search relevance matters more than a rough city rule.

Monitor and maintain the redirect system

Monitoring turns the map into a living system. Review server and CDN logs for chains, repeated status codes and unexpected traffic to old URLs. Compare search-console coverage, analytics landing pages and crawl reports regularly. A rise in direct traffic to an old address can reveal missed links, while a sudden 404 can expose a destination that failed after launch.

Give teams a documented route for reporting broken journeys. Record the issue against the relevant source and destination instead of copying feedback into a disconnected mailbox. In Australian offices, noting the affected state and local time helps when support shifts run across different hours. A short escalation path prevents a broken legacy link from remaining unnoticed for months.

Use related operational signals carefully. Teams supporting customers through messaging apps may consult background material such as Telegram device access while judging whether a surge reflects a campaign, a device-management event or wider demand. That context can shape investigation priorities, but it should not replace redirect-specific evidence such as response sequences and server logs.

Audit current routes on a schedule and after major releases. Remove redirects when a page is retired and its historical value no longer justifies a rule. Domain changes need extra scrutiny because .com.au and .au addresses may serve different audiences. Keep ownership with named teams and require a second check for rules affecting revenue, customer accounts or public information. Redirect records can contain customer identifiers, email campaign identifiers and other contextual data, so follow the Privacy Act 1988 and Australian Privacy Principles, minimise what is stored and restrict access. Do not put full email addresses, phone numbers or sensitive order details in free-text notes. Use a privacy-conscious mechanism rather than a personalised permanent redirect. Close each review with a disposition—retain, revise, retire or test again—and record the evidence and date so future teams understand why a route remains.