// open source reference

Redirect checklist for a site move

22 redirect steps for a site move, in four parts: before the move, on staging, on the day and after the move. Each step says what to look at. Where one-hop has a command for a step, the command is under it.

Updated

1. Before the move

  • Look atThe status and final_url columns. They show what each old URL answers today and where its redirects end.

    one-hop snapshot https://example.com/sitemap.xml --out snapshot.csv

    From one-hop README

  • Look atQuery-string links, date-based links and old redirects. Our sitemap listed only part of our 2,026 old addresses.

    one-hop snapshot https://example.com/sitemap.xml --urls extra-urls.txt --out snapshot.csv

    From one-hop README and our site move write-up

  • Look atRows where new is empty. Such a URL keeps its address and must answer 200 with no redirect. The filled file is your redirect map, called redirects.csv below.

    From one-hop README

  • Look atAny new URL that is also the old URL of another redirect in the map. That is a chain before the server adds anything.

    From our site move write-up

  • Look atRows that point at / or at an index page. Google's site move guidance says it can treat many old URLs sent to one unrelated page as soft 404s.

    From our site move write-up

  • Look atTrailing slashes count. /about and /about/ are two URLs. A server rule that adds the slash turns every redirect in the map into a chain.

    From one-hop tool page

  • Look atBoth are permanent in RFC 9110 and in Google's redirect doc. 302, 303 and 307 are temporary in both.

    From redirect status code reference

2. On staging

  • Look atThe count line, which reads 5/5 OK when all of five rules pass. Exit code 0 means every rule passed. Exit code 2 means nothing was checked.

    one-hop redirects.csv --base https://staging.example.com

    From one-hop tool page and one-hop README

  • Look atThe ONE_HOP_AUTH environment variable, which holds user:password. --auth works too. The password goes to your staging host only, never to a host a redirect points at.

    From one-hop tool page

  • Look atFAIL lines of kind chain, loop, temporary, wrong_target and no_redirect. A meta refresh fails as no_redirect, because the old URL answers 200.

    From one-hop README and redirect status code reference

  • Look atFAIL lines of kind not_found and bad_status. not_found means the old or the new URL answered 404 or 410. A kept page that redirects fails as redirected.

    From one-hop README

  • Look atThe file holds every hop of every rule, with its URL, status and Location.

    one-hop redirects.csv --base https://staging.example.com --json report.json

    From one-hop README

  • Look atThe exit code is 1 when any rule fails. The tool page has a job for each CI it covers.

    From one-hop tool page

3. On the day

  • Look atOur old site still answered ?p= links with a redirect. We recorded where each post ID led before we switched it off.

    From our site move write-up

  • Look atDuring our switch a laptop's DNS cache kept answering with the old site.

    From our site move write-up

  • Look atEvery rule passes. A redirect goes straight to a live page in one hop. A kept page answers 200 at its old path.

    one-hop redirects.csv --base https://example.com

    From one-hop tool page and our site move write-up

  • Look at--path-only compares only the path and the query of each target. A chain means another redirect ran first. A kept page fails here as redirected. On our site plain http:// takes two hops.

    one-hop redirects.csv --base https://www.example.com --path-only --limit 50

    From our site move write-up and one-hop README

  • Look atThe status line reads 301 or 308, and location holds the new URL.

    curl -sI https://example.com/about-us/ | grep -iE '^(HTTP|location)'

    From our site move write-up and redirect status code reference

4. After the move

  • Look atWe changed some targets the day after our move and ran all 2,026 rules again that day. Keep the CI job, with --base set to the live site.

    one-hop redirects.csv --base https://example.com

    From our site move write-up and one-hop README

  • Look atstatus is 200 on every row, and canonical is the same address as final_url.

    one-hop snapshot https://example.com/sitemap.xml --out live.csv

    From our site move write-up and one-hop README

  • Look atGoogle can treat them as soft 404s. We sent 96 old posts to our blog index and are watching them.

    From our site move write-up

  • Look atA passing test shows that the old addresses still work. It doesn't show that the search traffic followed them.

    From our site move write-up

Where the steps come from

The steps come from three places. They have the reasons and the numbers. This page is the order to work in.

The commands were checked against one-hop 0.2.0 on . That release needs Python 3.11 or later. Install it with pip install one-hop.

The checklist text is under CC BY 4.0. Copy it or change it, and credit Synapse with a link to this page.