Redirects are HTTP responses that forward users from one URL to another. The main types are 301 (permanent) which passes link equity, and 302 (temporary) for short-term changes. Use 301 redirects for site migrations, URL changes, and domain consolidation. Avoid redirect chains and loops. Implement at server level when possible.

Redirects are HTTP responses that forward users from one URL to another. The main types are 301 (permanent) which passes link equity, and 302 (temporary) for short-term changes. Use 301 redirects for site migrations, URL changes, and domain consolidation. Avoid redirect chains and loops. Implement at server level when possible.

What Are Redirects?

A redirect tells browsers and search engines that a URL has moved to a new location. When a redirect is encountered, the user is automatically sent to the new URL.

Redirect purposes:

  • Move content to new URLs
  • Consolidate duplicate pages
  • Handle deleted pages
  • Migrate to new domains
  • Enforce HTTPS/www preferences

Types of Redirects

301 Redirect (Permanent)

Indicates the page has permanently moved.

Characteristics:

  • Passes most link equity
  • Browsers cache it
  • Search engines update their index
  • Original URL removed from index

Use for:

  • URL changes
  • Site migrations
  • Domain changes
  • Consolidating content

302 Redirect (Temporary)

Indicates a temporary move.

Characteristics:

  • May not pass full link equity
  • Not cached long-term
  • Original URL kept in index
  • Treated similarly to 301 by Google

Use for:

  • A/B testing
  • Maintenance pages
  • Geo-redirects
  • Short-term promotions

307 Redirect (Temporary)

HTTP 1.1 version of 302, preserves request method.

Characteristics:

  • Preserves POST requests
  • Similar SEO impact to 302
  • Used in HSTS redirects

308 Redirect (Permanent)

HTTP 1.1 version of 301, preserves request method.

Characteristics:

  • Permanent like 301
  • Preserves POST requests
  • Less commonly used

Meta Refresh

HTML-based redirect (not recommended for SEO).

<meta http-equiv="refresh" content="0; url=https://example.com/new-page/">

Issues:

  • Slower than server redirects
  • May not pass full link equity
  • Poor user experience

JavaScript Redirect

Client-side redirect (not recommended for SEO).

window.location.href = "https://example.com/new-page/";

Issues:

  • Search engines may not follow
  • Requires JavaScript
  • Slower execution

Redirect Comparison

TypeUse CaseLink EquitySEO Status
301Permanent changesPassesRecommended
302Temporary changesMay passUse carefully
307Temporary (POST)May passTechnical use
308Permanent (POST)PassesTechnical use
Meta refreshAvoidPartialNot recommended
JavaScriptAvoidUncertainNot recommended

Implementing Redirects

Apache (.htaccess)

Single redirect:

Redirect 301 /old-page/ https://example.com/new-page/

Pattern redirect:

RedirectMatch 301 ^/blog/([0-9]+)/(.*)$ /blog/$2

Rewrite rule:

RewriteEngine On
RewriteRule ^old-page/?$ /new-page/ [R=301,L]

Nginx

Single redirect:

location /old-page/ {
    return 301 https://example.com/new-page/;
}

Pattern redirect:

rewrite ^/blog/([0-9]+)/(.*)$ /blog/$2 permanent;

WordPress

Using .htaccess (above WordPress rules)

Using plugin:

  • Yoast SEO
  • Redirection plugin
  • Rank Math

JavaScript Frameworks

Next.js (next.config.js):

module.exports = {
  async redirects() {
    return [
      {
        source: '/old-page',
        destination: '/new-page',
        permanent: true,
      },
    ];
  },
};

Astro (astro.config.mjs):

export default {
  redirects: {
    '/old-page': '/new-page',
  },
};

Common Redirect Scenarios

Domain Migration

Moving entire site to new domain.

# Old domain .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$
RewriteRule (.*)$ https://newdomain.com/$1 [R=301,L]

HTTP to HTTPS

Forcing secure connection.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

WWW to Non-WWW

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]

Non-WWW to WWW

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

Trailing Slash Enforcement

Add trailing slash:

RewriteCond %{REQUEST_URI} /+[^\.]+$
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]

Remove trailing slash:

RewriteCond %{REQUEST_URI} /.+/$
RewriteRule ^(.+)/$ /$1 [R=301,L]

Redirect Best Practices

Avoid Redirect Chains

Bad (chain):

Page A → Page B → Page C → Page D

Good (direct):

Page A → Page D
Page B → Page D
Page C → Page D

Avoid Redirect Loops

Loop:

Page A → Page B → Page A (endless loop)

Fix: Audit redirects before implementing

After implementing redirects:

  1. Update all internal links to new URLs
  2. Reduce redirect dependence
  3. Improve page speed

Keep Redirects in Place

  • Minimum 1 year
  • Indefinitely for pages with backlinks
  • Monitor for continued traffic

Match URL Components

# Preserve path structure
RewriteRule ^old/(.*)$ /new/$1 [R=301,L]

Redirect Problems

Common Issues

ProblemCauseSolution
Redirect chainMultiple hopsDirect to final URL
Redirect loopCircular referenceAudit and fix rules
Lost link equityWrong redirect typeUse 301 for permanent
Slow redirectsToo many redirectsReduce redirect count

Diagnosing Problems

Tools:

  • Screaming Frog (crawl redirects)
  • Chrome DevTools (Network tab)
  • httpstatus.io (check individual URLs)
  • Search Console (coverage errors)

Site Migration Redirects

Pre-Migration

  1. Crawl old site completely
  2. Map old URLs to new URLs
  3. Create redirect rules
  4. Test on staging

During Migration

  1. Implement redirects
  2. Update internal links
  3. Submit new sitemap
  4. Update Search Console

Post-Migration

  1. Monitor Search Console errors
  2. Check redirect functionality
  3. Monitor organic traffic
  4. Update external links where possible

See crawlability for migration best practices.

Redirect Checklist

Planning

  • Old URLs documented
  • New URLs mapped
  • Redirect type selected (301/302)
  • Rules tested on staging

Implementation

  • Redirects implemented at server level
  • Internal links updated
  • Sitemap updated
  • Search Console notified

Verification

  • No redirect chains
  • No redirect loops
  • All redirects return correct status
  • Critical pages accessible

Monitoring

  • Search Console errors monitored
  • Traffic monitored
  • Redirects tested regularly
  • Documentation maintained

Conclusion

Redirects are essential for maintaining SEO equity during URL changes and site migrations. Use 301 redirects for permanent changes, 302 for temporary ones. Implement at server level for best performance.

Avoid redirect chains and loops. Keep redirects in place long-term for pages with backlinks. Update internal links to reduce redirect dependence over time.

Combine proper redirect management with canonicalization and URL structure best practices for clean, crawlable site architecture.

Frequently Asked Questions

Do 301 redirects pass full link equity?
301 redirects pass most link equity, but there may be small losses. Google has said 301s, 302s, and canonicals are treated similarly for PageRank. However, for permanent changes, 301s are preferred as they clearly signal the change is permanent. The destination page inherits most ranking signals from the original.
When should I use 302 vs 301 redirects?
Use 301 for permanent changes - the old URL will never come back. Use 302 for temporary situations - A/B testing, maintenance pages, seasonal content, or when you plan to restore the original URL. If unsure, 301 is usually the safer choice for SEO purposes.
How long should I keep redirects in place?
Keep redirects in place indefinitely for important pages, especially those with backlinks. Google continues to follow redirects to understand URL changes. At minimum, keep redirects for 1 year after migration. For high-value pages with external links, keep them permanently.