Home/Glossary/URL Redirection

URL Redirection

A technique that forwards users from one URL to another, often used for site migrations or link shortening.

Web SecurityAlso called: "http redirect", "url forwarding"

Redirects guide browsers and search engines to the correct destination.

Types of redirects

  • 301 (Permanent): Old URL replaced forever (passes SEO value).
  • 302 (Temporary): Short-term redirect (does not pass SEO value).
  • 303 (See Other): POST request redirected to GET.
  • 307/308: Preserve HTTP method in redirect.

Security risks

  • Open redirects: Attacker-controlled destination can be used for phishing.
  • Redirect chains: Multiple hops slow performance and confuse users.
  • Unvalidated redirects: Can bypass authentication or access controls.

Best practices

  • Validate destination URLs against allowlist.
  • Limit redirect chains to 3-5 hops maximum.
  • Use 301 for permanent moves, 302 for temporary.