HTTP Redirect
An HTTP redirect occurs when a server tells a client to access a different URL. Redirects are typically indicated using status codes like 301 (permanent) or 302 (temporary).
Also known as: URL redirection, 3xx redirects.
Comparisons
- 301 vs. 302 Redirects: 301 is for permanent changes, while 302 is for temporary ones.
- Server-side vs. Client-side Redirects: Server-side uses HTTP codes; client-side often relies on JavaScript.
Pros
- Seamless navigation: Guides users or clients to updated URLs.
- SEO retention: Helps maintain search rankings for moved content.
Cons
- Performance impact: Additional round trips can slow access.
- Misconfiguration risks: Improper redirects can cause loops or errors.
Example
A website redirects outdated product pages to new ones using a 301 redirect.