Documentation/Redirects Overview

Redirects Overview

Understand redirect types, status codes, and best practices for URL management.

Redirect Status Codes

301 - Permanent RedirectRecommended for SEO

Use when the URL has permanently moved. Search engines will update their index to the new URL and pass link equity.

302 - Temporary RedirectUse sparingly

Use when the redirect is temporary. Search engines will keep the original URL in their index.

307 - Temporary RedirectPreserves method

Like 302, but explicitly preserves the HTTP method (GET, POST, etc.) of the original request.

308 - Permanent RedirectPreserves method

Like 301, but explicitly preserves the HTTP method of the original request.

Redirect Types

Path Redirects

Simple redirects from one path to another.

/old → /new

Regex Redirects

Pattern-based redirects for dynamic URLs.

/blog/(.*) → /articles/$1

Cross-Domain

Redirect between different domains.

old.com → new.com

Query Preserving

Keep query parameters in redirects.

/page?id=1 → /new?id=1

Best Practices

  • Use 301 redirects for permanent URL changes to preserve SEO value
  • Avoid redirect chains (A → B → C) - redirect directly to the final destination
  • Test redirects in staging before deploying to production
  • Monitor analytics to ensure redirects are working as expected