A 301 redirect is a server instruction that says a URL has moved permanently, so browsers and search engines send visitors and ranking signals to the new address. It is the tool you use when you change a URL, merge two pages, move to HTTPS or switch domains.
What is a 301 redirect, and what are the other types?
When someone requests an old URL, the server answers with a status code and a Location header holding the new URL. The code carries the meaning. Google’s documentation sorts redirects into two groups:
| Type | Codes and methods | What Google does |
|---|---|---|
| Permanent | HTTP 301 and 308 (server-side, preferred), instant meta refresh, JavaScript redirect | Treats the target as the canonical URL, so the new address shows in results. |
| Temporary | HTTP 302, 303, 307, delayed meta refresh | Does not signal canonicalization, so the old page can stay in results. |
The difference between 301 and 308 (and 302 and 307) is about request methods and matters for forms and APIs. For SEO, treat 301 and 308 as permanent and 302 and 307 as temporary. Google says to use permanent redirects “when you’re sure that the redirect won’t be reverted” and says server-side redirects are the most reliably understood. JavaScript redirects are a last resort, because rendering can fail and Google can miss them (see JavaScript SEO).
Why do redirects matter for SEO?
A page that has earned links and rankings loses both when its URL changes without a redirect: the old address returns a 404 and the links point at nothing. A permanent redirect carries the signals to the new URL and keeps visitors from hitting an error. Redirects are also the strongest of the canonicalization signals Google lists, stronger than a canonical tag or a sitemap entry.
When should you use a redirect?
- You change a URL (new slug, new folder structure, see URL structure).
- You merge or delete a page that has a close replacement.
- You move to HTTPS or settle on one hostname (see HTTPS).
- You change domains or rebrand.
- You fix duplicate versions such as www and non-www or with and without a trailing slash.
Use a temporary redirect (302 or 307) for short-term cases only, such as a page down for maintenance or a limited test.
How do you set up redirects, step by step?
-
List the old URLs. Collect them from your sitemaps, analytics, server logs, Search Console’s links report and your CMS. Include images, PDFs and other files with traffic or links.
-
Map each old URL to its closest new equivalent, in a spreadsheet. Match topic to topic. Google warns that sending many old URLs to one unrelated page, such as the new homepage, can confuse users and may be treated as a soft 404. Redirecting several old pages into one consolidated new page is fine.
-
Write the rules on the server. Examples from Google’s documentation:
# Apache (mod_alias) Redirect permanent "/old-page" "https://example.com/new-page"# Nginx location = /old-page { return 301 https://example.com/new-page; }WordPress plugins, Shopify’s URL redirects, Netlify’s
_redirectsfile and Vercel’svercel.jsondo the same job without server access. -
Point straight at the final URL. Googlebot follows up to 10 hops, but Google advises one hop. Where chains cannot be avoided, keep them short: ideally no more than 3 redirects and fewer than 5. Update old rules so A goes to C directly, not to B and then C.
-
Update everything that points at the old URL: internal links, canonical tags, the XML sitemap, hreflang tags and your own social profiles. The sitemap should list only final URLs (see XML sitemaps).
-
Test. Run
curl -I https://example.com/old-pageand check for301and the rightLocation. Then crawl the old list with Screaming Frog and look for chains, loops and non-200 end points. -
Use Change of Address for domain moves. Google’s documentation says to submit it in Search Console only when moving between domains or subdomains, not for HTTP to HTTPS, www to non-www or path changes.
-
Keep the redirects. Google says to keep them “for as long as possible, generally at least 1 year”, so signals can transfer to the new URLs.
How do you measure the result?
- Search Console Page indexing report: old URLs should show “Page with redirect” and the new ones should appear as indexed over the following weeks. Google may keep showing old URLs occasionally during a domain move and they fade over time.
- Performance report: compare clicks and impressions for the new URLs against the old ones before the move.
- A crawl after launch: zero redirect chains, zero loops, zero internal links that still point at redirected URLs.
- Server logs or analytics: traffic to old URLs drops as the new ones take over.
What mistakes should you avoid?
- Redirecting everything to the homepage. Visitors and Google get a page they did not ask for. Use a custom 404 page when no replacement exists.
- Redirect chains and loops. Each hop adds wait time and risk.
- Using 302 for a permanent move, which leaves the old URL in results.
- Removing redirects after a few weeks. Keep them at least a year.
- Leaving internal links on old URLs. Redirects are for outside links and old bookmarks, so fix your own links at the source (see broken links).
- Redirecting to a URL that is blocked, noindexed or returns an error.
Where can you learn more?
The free digital marketing module of the Fe/male Switch startup school covers the checks to run before any relaunch. Next steps on SEO100: confirm the new URLs in the page indexing report and keep your canonical tags in line with the redirect targets.