07887 423199me@richieaubin.com

Set up permanent redirects on your website

If a page has moved for good, give its old address a permanent route to the right replacement. Start with one example, test it, then expand the mapping.

Permanent redirect rules example
Example image · CC0 1.0 licence

Choose a way to do this check

CMS or hosting panel

  1. Add the exact source path and final destination, then choose Permanent or 301.
  2. Test it in a browser using Preserve log, including an unaffected URL and any required query string.

Screaming Frog

  1. Upload the old addresses in List mode and enable redirect following where needed.
  2. Compare the first status, final address and hop count with the agreed map.

Test a proposed map on this site

  1. Load the example CSV to find conflicts or chains in the mapping itself.
  2. After deployment, check the live responses separately in a crawler.
Example redirect audit: the local workbench spots chains and conflicts before a map is deployed.
Example redirect audit: the local workbench spots chains and conflicts before a map is deployed.

Follow the illustrated walkthroughs for Screaming Frog’s redirect report.

1. Choose the old and new addresses

  1. Open the old address and record what it currently returns. Keep the exact spelling, host and path. Copy it to a change sheet.
  2. Open the new address. Confirm that it is live and fulfils the same purpose. An old size guide should usually lead to the new size guide, not the homepage.
  3. Decide whether the rule should apply to both slash variants. Decide whether incoming query strings should follow the redirect. Tracking values may be safe to keep, while a parameter from an old application can change the new page unexpectedly.
  4. Keep the mapping next to a control URL that should not redirect. For a larger migration, use the redirect mapping guide before creating rules.

Audit redirect mappings in bulk before and after rollout

Keep a master list of old URLs and expected final addresses. A mapping checker should flag wrong destinations as well as errors and chains. Use exact addresses for the test, including relevant query variants if the policy depends on them.

  1. In Screaming Frog, choose Mode → List and paste or upload the old URLs. Enable Always Follow Redirects in the Spider settings if needed to record the full path, then run a sample before uploading the full batch.
  2. Export the appropriate redirect report. Compare Original URL or the source with your mapping sheet, then review the first status, number of hops, final address and final status. Prioritise wrong destinations, loops and errors ahead of cosmetic variations.
  3. For redirects found in WebSite Auditor, open the relevant Site Audit factor and review the affected URLs or reported chains. In Pages, review links to redirects so you can update the source links. Use Rebuild Project to confirm changes to discovered routes. Keep the original external or legacy URL list independently so you do not lose addresses a discovery crawl cannot find.
  4. Test a small approved batch on staging where practical. After release, repeat the same checks through the public host and verify an unaffected URL. Retain the old rules or a previous export so the hosting team can roll back a bad mapping.
Redirect acceptance sheet · compare expected and actual values
Original URL,Expected first status,Expected final URL,Expected final status,Actual hops,Decision
https://www.example.com/old-guide/,301,https://www.example.com/guides/new-guide/,200,,Check direct route

2. Try your CMS or hosting control panel first

If a CMS, hosted platform or redirect manager owns routing, use its interface. The exact labels and behaviour vary. Check whether another layer already redirects the URL before adding a second rule.

  1. Open the site’s redirect manager and choose the option to add a redirect. Paste the old path into Source and the final address into Destination using the format that interface expects.
  2. Choose Permanent or 301 for this task. Keep matching exact unless you deliberately need a pattern. Check any setting for slash variants or query handling before saving.
  3. Preview the change on staging where available. Open the old URL in a private browser window and confirm that the new page is the right one.
  4. In the browser Network panel, enable Preserve log and load the old address again. Select the first document request and check that it returns 301 with the intended Location, then check that the new address returns 200. The browser HTTP guide shows where to find those fields.

If the redirect manager cannot deliver the intended result, ask the host which layer owns it. You only need one of the following server methods.

3. Apache 2.4: use the document-root .htaccess file

  1. Confirm your host uses Apache for this request and allows mod_rewrite directives in the site’s .htaccess context. In a hosting file manager, enable hidden files if .htaccess is not visible and download a copy before editing.
  2. Open the .htaccess file in the document root serving this site. Insert the specific rule above the CMS’s general routing block. Reuse an existing RewriteEngine On declaration.
  3. Replace the sample paths and domain, save and test the old URL plus an unaffected page. In document-root .htaccess, the matched URL path has no leading slash. This example preserves incoming query strings.
Apache site root · .htaccess
RewriteEngine On
RewriteRule ^old-guide/?$ https://www.example.com/guides/new-guide/ [R=301,L]

If a public request returns a server error, restore the saved file and ask your host to check its error log and allowed overrides. On Apache 2.4, use QSD only if you deliberately want to discard the original query and have tested that requirement.

4. Nginx: use exact locations in the serving block

  1. Confirm the request is handled by Nginx and identify the server block for the old host and scheme. On managed hosting, have the host or authorised administrator use the supported configuration editor.
  2. Add the two exact locations to that block after checking there is no existing rule for the same paths. Replace the destination with the final address.
  3. Run the configuration test through your host’s interface or use nginx -t if you administer the server. Reload only after the test passes, then verify both slash variants.
Nginx · exact match locations
location = /old-guide/ {
    return 301 https://www.example.com/guides/new-guide/$is_args$args;
}
location = /old-guide {
    return 301 https://www.example.com/guides/new-guide/$is_args$args;
}

The variables preserve the original query when there is one. Nginx does not read Apache’s .htaccess file. If Nginx sits in front of Apache, decide which layer should own the rule and avoid managing the same route twice.

5. IIS: use URL Rewrite

  1. Open IIS Manager, select the site and open URL Rewrite. If it is missing, confirm that the IIS URL Rewrite module is installed or ask the hosting team.
  2. Add a blank inbound rule and match the site-relative path. Use ^old-guide/?$ as the example pattern. Choose Redirect as the action, paste the final address and select Permanent (301).
  3. Enable query-string retention if that is the policy you intend, stop processing further rules for the match and apply. Alternatively, add the following rule inside the site’s existing system.webServer, rewrite, rules section of web.config.
IIS site-root web.config · inside rewrite/rules
<rule name="Move old guide" stopProcessing="true">
  <match url="^old-guide/?$" />
  <action type="Redirect"
          url="https://www.example.com/guides/new-guide/"
          appendQueryString="true"
          redirectType="Permanent" />
</rule>

6. Test the entire journey before expanding the rollout

Test the slash and no-slash addresses, a meaningful query-string case and a similar unaffected URL. A normal result is one redirect to the intended working replacement. Test the landing page content as well as its status. If a redirect unexpectedly matches another route, narrow the pattern or restore the saved settings.

After testing, update internal links, sitemap references and canonicals to point straight at the preferred address. Keep the rule because external links and bookmarks may still use the old URL. Avoid publishing a large batch until a representative sample works for visitors and the response checks agree.

Technical references

Frequently asked questions

Can I do this without editing server files?

Yes if your CMS, host or redirect manager provides a suitable interface. Check that its result is an actual server response and use Network to verify it.

Should I use 301 or 302?

Use 301 for a lasting move, and 302 for a temporary change where its method behaviour fits. If requests must retain their method, consider the relevant 307 or 308 behaviour before changing an application endpoint.

Is a homepage redirect better than a 404?

Use a relevant replacement if one exists. An unrelated homepage does not answer the original request. A genuine missing page can return an honest 404.

Why does Apache use no leading slash here?

A document-root .htaccess rule works relative to that directory. A rule in a different context can see a different path. Match the syntax to where it is installed.

Should the redirect preserve UTM parameters?

Often it is useful to retain tracking values. Test a representative query and decide what to do with application-specific parameters. The examples all retain the query.

Why is the old rule still working after I removed it?

An edge cache or browser may still hold the redirect, or another layer may also be responsible. Test a fresh request and check where the response is generated.

What is a redirect chain?

It is more than one redirect before the final page. Update the old rule to point directly to the final URL when you control the mapping and the destination is correct.

What should I do if the site starts returning 500?

Restore the saved configuration using the normal rollback process. Verify a healthy page, then check the error log or ask the host to identify the invalid directive.

How do I test thousands of redirects without visiting them manually?

Use your mapping sheet as the crawl input and compare each reported final address to its expected destination. Review a shortlist of failures and check representative examples in the browser.

Can I find every old URL in a normal site crawl?

No. Old URLs often have no live internal link. Keep migration mappings, traffic exports and historical references as independent sources.

Written by Richie Aubin

Published