SEO audit All SEO tools Site vs Site Blog Search

Language

EnglishالعربيةEspañolFrançaisDeutschPortuguêsItalianoРусскийTürkçeRomânăBahasa Indonesia简体中文日本語हिन्दी
Sign in

On-page SEO

Meta Tags AnalyzerSERP Snippet PreviewHeading Structure CheckerImage Alt Text CheckerOpen Graph & Social Preview CheckerStructured Data ValidatorCanonical Tag CheckerLink AnalyzerHreflang Checker

Technical SEO

Full Site Audit (Crawler)Robots.txt TesterXML Sitemap CheckerRedirect CheckerBulk HTTP Status CheckerHTTP Headers CheckerBroken Link CheckerIndexability CheckerMobile-Friendly CheckerJavaScript SEO Checker

Speed & performance

Page Speed TestCore Web Vitals CheckerServer Response Time (TTFB) TestPage Size CheckerGzip & Brotli Compression TestHTTP/2 & HTTP/3 CheckerCSS MinifierJavaScript Minifier

Content & keywords

Keyword Density CheckerKeyword Suggestion ToolWord CounterReadability CheckerText to HTML Ratio CheckerURL Slug GeneratorCase Converter

Generators

Meta Tag GeneratorRobots.txt GeneratorSchema Markup GeneratorOpen Graph GeneratorXML Sitemap GeneratorRedirect Generator (.htaccess & Nginx)Hreflang Tag GeneratorUTM Campaign URL Builderllms.txt Generator

Domain & security

SSL Certificate CheckerSecurity Headers CheckerDNS LookupWHOIS / Domain LookupDomain Age CheckerMixed Content CheckerWebsite IP & Hosting LookupWebsite Technology Checker

AI search & AI writing

AI Search Readiness CheckerAI Title & Meta Description GeneratorAI FAQ & Schema GeneratorAI Content Brief GeneratorAI Content Optimizer
Technical SEO

Redirects for SEO: 301, 302 and How to Migrate a Site Safely

Redirects keep visitors and rankings when URLs change. Learn which redirect to use, how to avoid chains and loops, and a step-by-step plan for migrating a site without losing traffic.

URLs change. Pages get renamed, products are discontinued, sites move to HTTPS, brands change their domain. Every time a URL changes, a redirect sends visitors and search engines from the old address to the new one – and carries the old page’s rankings and links with it.

Getting redirects wrong is one of the fastest ways to lose search traffic. Getting them right is mostly a matter of planning.

The main redirect types

Code Name Use it when
301 Moved Permanently The page has moved for good. The most common SEO redirect.
308 Permanent Redirect Same as 301, but the request method (e.g. POST) must not change.
302 Found (temporary) The move is temporary and the original URL will return.
307 Temporary Redirect Same as 302, but keeps the request method.

For SEO, the key distinction is permanent vs temporary. With a permanent redirect, search engines replace the old URL with the new one in their index. With a temporary redirect, they generally keep the old URL indexed because you said it is coming back.

Google has said that 301 and 302 redirects both pass PageRank. But if you use a 302 for a permanent move, Google may keep showing the old URL for longer. Use permanent redirects for permanent changes.

Redirects to avoid

Meta refresh redirects (<meta http-equiv="refresh">) and JavaScript redirects work, but they are slower, less reliable for crawlers and confusing for users pressing the back button. Use server-side redirects whenever possible.

Redirect chains happen when URL A redirects to B, which redirects to C. Each hop adds delay, and crawlers may stop following after several hops. Update redirects so every old URL points straight to the final destination.

Redirect loops – A redirects to B, which redirects back to A – make a page impossible to load.

Redirect Checker

Trace every hop of a redirect chain with status codes and timings.

Open the Redirect Checker

Where to redirect

Redirect each old URL to the most relevant equivalent new page:

  • Old product → the replacement product, or its category if there is no replacement
  • Old article → the updated version of the article, or the closest related article
  • Old category → the new category

Avoid redirecting everything to the homepage. Google tends to treat irrelevant redirects to the homepage as soft 404s – the signals are not passed on – and visitors are left confused. If there is truly no equivalent page, a helpful 404 or 410 page is better.

How to set up redirects

Apache (.htaccess)

Most cPanel shared hosting uses Apache. Add rules to the .htaccess file in your site’s root:

Redirect 301 /old-page /new-page

Nginx

location = /old-page { return 301 /new-page; }

CMS plugins and settings

WordPress plugins such as Redirection or the redirect managers in Yoast and Rank Math let you add redirects without touching server files. Shopify, Wix, Squarespace and Webflow all have built-in redirect settings.

Redirect Generator (.htaccess & Nginx)

Create 301 redirect rules for Apache .htaccess and Nginx, including HTTPS and www.

Open the Redirect Generator (.htaccess & Nginx)

Site migration: a step-by-step plan

A migration – a new domain, a new CMS, a new URL structure or HTTPS – changes many URLs at once. Plan it carefully.

Before the migration

  1. Benchmark. Record current traffic, rankings and indexed pages from Search Console and analytics.
  2. Crawl the old site and export every URL, plus URLs from your sitemap, analytics landing pages and your backlink data. Pages with external links matter most.
  3. Build a redirect map: a spreadsheet with every old URL and its new destination.
  4. Keep what works. If you can keep URLs the same, do. Each changed URL carries some risk.
  5. Prepare the new site on a staging environment protected by a password, not just a robots.txt block.

On launch day

  1. Put the redirects live at the same moment the new site goes live.
  2. Remove any staging restrictions (password, Disallow: /, noindex).
  3. Test a sample of old URLs, especially high-traffic and highly linked ones.
  4. Update internal links to point to new URLs directly.
  5. Submit the new sitemap in Search Console. For a domain change, use Search Console’s Change of Address tool.
Bulk HTTP Status Checker

Check the status code, redirects and response time of up to 25 URLs at once.

Open the Bulk HTTP Status Checker

After the migration

  1. Crawl the new site for broken links, redirect chains and missing pages.
  2. Monitor Search Console daily for crawl errors and indexing changes.
  3. Watch 404 reports for old URLs you missed, and add redirects for them.
  4. Keep redirects in place for at least a year – permanently for URLs with valuable backlinks.

Some ranking fluctuation in the first weeks is normal. A sustained drop usually means missing redirects, blocked crawling or content that was removed or changed.

HTTP to HTTPS

When moving to HTTPS, redirect every HTTP URL to its HTTPS equivalent with a 301, update internal links and canonical tags to HTTPS, and add the HSTS header once everything works. Check for mixed content – images or scripts still loaded over HTTP.

www vs non-www

Choose one version and redirect the other to it, so search engines see a single site. It does not matter which you choose for SEO; consistency is what counts.

Building a redirect map

The redirect map is the single most important document in a migration. A simple spreadsheet works:

Old URL New URL Type Priority Notes
/services/seo-audit.php /services/seo-audit 301 High 45 referring domains
/blog/2019/05/title-tags /blog/title-tags 301 High Top organic landing page
/products/discontinued-x /category/x-alternatives 301 Medium No direct replacement
/old-promo – 410 Low Expired campaign, no links

How to fill it:

  1. Collect every old URL from a crawl, your sitemap, analytics (landing pages over the last year), Search Console (top pages) and backlink reports.
  2. Match them to new URLs. Where URL patterns change systematically (for example, removing .php), a pattern-based rule can cover thousands of URLs at once.
  3. Prioritise by traffic and links so the most valuable URLs are tested first.
  4. Check for chains: if an old URL already redirects somewhere, point it straight to the final new URL.

Pattern-based redirects

When URLs change in a consistent way, one rule can replace thousands of individual redirects. For example, to remove .php from every URL on Apache:

RewriteEngine On
RewriteCond %{THE_REQUEST} \s/([^.]+)\.php[\s?] [NC]
RewriteRule ^ /%1 [R=301,L]

Or to move a blog from /blog/2019/05/post-name to /blog/post-name:

RewriteRule ^blog/\d{4}/\d{2}/(.+)$ /blog/$1 [R=301,L]

Test pattern rules carefully on staging – a small mistake can redirect pages that should not move.

Monitoring after launch

In the weeks after a migration, keep a close eye on:

  • 404 errors in Search Console and your server logs – each one is a URL you may have missed
  • Indexing of the new URLs in the Page indexing report
  • Traffic to top landing pages compared with your benchmark
  • Rankings for your most important queries

Expect some turbulence for a few weeks while search engines recrawl and process the redirects. Large sites may take months to settle fully.

Redirect hygiene for everyday changes

Migrations are not the only time redirects matter. Make it a habit to:

  • Add a 301 whenever you change a URL slug or delete a page that has a sensible replacement
  • Update internal links after adding redirects, so the site links directly to final URLs
  • Review your redirect list once a year to remove chains and fix redirects pointing to pages that have since moved again

Key takeaways

  • Use permanent (301 or 308) redirects for permanent moves and temporary ones only for genuinely temporary changes.
  • Redirect each old URL to its most relevant new equivalent, not to the homepage.
  • Avoid redirect chains and loops; point every old URL straight to its final destination.
  • A complete redirect map built from crawls, analytics and backlink data is the core of any migration.
  • Launch redirects at the same moment as the new site and monitor 404s closely afterwards.
  • Keep redirects for at least a year – permanently for URLs with valuable backlinks.

Frequently asked questions

How long should I keep redirects?

Google recommends at least a year. Keeping them permanently is safest for URLs with backlinks or bookmarks, and the cost is negligible.

Do redirects slow down my site?

A single server-side redirect adds a small delay. Chains of several redirects add up, so point directly to the final URL.

Will I lose rankings with a 301?

A correctly mapped 301 redirect generally preserves rankings, though there can be temporary fluctuation while search engines process the change.

Should I use 410 instead of 404 for deleted pages?

Both tell search engines a page is gone. A 410 says it is gone deliberately and may be dropped from the index slightly faster. Either is fine for pages with no replacement.

redirects301site migration

Check your own site

Run a free audit with 55+ checks and get a fix for every issue.

Run free audit

Keep reading