Types of redirects
| Code | Meaning | Use it when |
|---|---|---|
| 301 | Moved Permanently | A page has moved for good. The most common redirect for SEO. |
| 308 | Permanent Redirect | Permanent like a 301, but the request method (such as POST) is kept. |
| 302 | Found | The move is temporary and the old URL should be kept. |
| 307 | Temporary Redirect | Temporary like a 302, with the request method kept. |
| Meta refresh, JavaScript | Done in the page, not by the server | Only when you cannot set server redirects. Search engines can follow them, but server-side redirects are more reliable. |
If a page is gone and has no replacement, a 410 (Gone) or 404 response is more honest than a redirect to an unrelated page.
When to use a redirect
- After a redesign or a change of URL structure.
- When you move to a new domain.
- When you switch from HTTP to HTTPS.
- When you merge two pages on the same topic into one.
- When you choose between the www and non-www version of your address.
Redirects and SEO
Redirects keep visitors, rankings and links when URLs change. Point each old URL to the closest matching new page, avoid chains of several redirects, and update internal links so they point straight to the final URL. Google says a permanent redirect is a strong signal that the new URL should be shown in search results, while a temporary one signals that the old URL should stay. Redirecting many old pages to an unrelated page, such as the home page, can be treated as a soft 404 and gives visitors a poor experience.
Common redirect problems
- Redirect chains: A to B to C. Each hop adds delay, so link straight to C.
- Redirect loops: A to B and back to A, which the browser stops with an error.
- Wrong type: using a 302 for a permanent move.
- Lost parameters or paths: the redirect drops part of the address.
- Old redirects left in place after the content returns.
How to set up and check a redirect
How you set a redirect depends on your platform. In WordPress, a plugin such as Redirection, or Rank Math’s redirections, lets you add rules without code. On Apache you can use a rule in the .htaccess file, and on Nginx a rule in the server configuration. Many hosts and content delivery networks have a redirect setting as well.
To check one, open the old URL in a browser and see where you land, or use the URL Inspection tool in Google Search Console, or a crawler that reports status codes. Test a sample of old URLs after any migration.
Redirect FAQs
What is the difference between a 301 and a 302 redirect?
A 301 says the move is permanent. A 302 says it is temporary. Search engines treat them differently, so use the one that matches your intent.
Do redirects hurt SEO?
A single, correct redirect is normal and keeps most of a page’s value. Chains, loops and redirects to unrelated pages cause problems.
How long should I keep a redirect?
Keep a permanent redirect for as long as the old URL still has links or visitors, which in practice is at least a year and often indefinitely.