A redirect sends visitors and search engines from one URL to another. Choosing the right type tells Google which URL to show in search results. Create the code for your server with the .htaccess redirect generator.
Quick answer: Use a 301 redirect when a page has moved permanently, such as after changing a URL, merging pages or moving to HTTPS. Use a 302 when the move is temporary and the original URL will come back, such as during maintenance or a short promotion. Google treats a 301 as a strong signal that the new URL should be shown in search, and a 302 as a weak signal, so the old URL may stay indexed. Both pass link signals. 308 and 307 are the permanent and temporary versions that keep the request method.
Redirect types at a glance
| Code | Meaning | How Google treats it | Use for |
|---|---|---|---|
| 301 | Moved permanently | Strong signal the target should be canonical | URL changes, merged pages, HTTPS, domain moves |
| 308 | Permanent, keeps method | Same as 301 | Permanent moves where forms or APIs post data |
| 302 | Found (temporary) | Weak signal; old URL may stay indexed | Short-term moves, maintenance, some tests |
| 307 | Temporary, keeps method | Same as 302 | Temporary moves for forms or APIs |
Do redirects lose ranking power?
Google has said that both permanent and temporary redirects pass PageRank, and that the main difference is which URL it shows in search results. With a 301, signals are consolidated on the new URL. If a 302 stays in place for a long time, Google may start treating it like a 301.
When to use a 301
- You changed a page's URL or slug.
- You merged two similar pages into one.
- You moved from HTTP to HTTPS, or between www and non-www.
- You moved to a new domain.
- You deleted a page and a close replacement exists.
When to use a 302
- A product is temporarily out of stock and you send people to a category for now.
- A page is under maintenance.
- A short seasonal campaign page temporarily replaces a normal one.
If you aren't sure whether a move is temporary, it probably isn't: use a 301.
Common mistakes
- Redirect chains: A to B to C slows pages and wastes crawling. Point A straight to C.
- Redirect loops: A to B and back to A, which breaks the page.
- Redirecting everything to the home page: Google may treat irrelevant redirects as soft 404s. Redirect to the closest matching page, or let truly gone pages return 404 or 410.
- Forgetting internal links: update links on your own site to point straight to the new URL.
- Removing redirects too soon: keep them for at least a year after a site move.
Check your redirects
Test a URL with the 301/302 redirect checker to see each hop and status code, find broken internal links with the broken link checker and update your sitemap with the XML sitemap generator. See XML sitemaps explained. More tools are in the SEO tools guide.
Based on Google Search Central documentation as at November 2026.
Frequently asked questions
What is the difference between a 301 and a 302 redirect?
A 301 means the page has moved permanently. A 302 means the move is temporary and the original URL will return.
Do 302 redirects pass PageRank?
Yes. Google has said both 301 and 302 redirects pass link signals. The difference is mainly which URL appears in search.
Which redirect should I use for HTTPS?
A 301 or 308 permanent redirect from every HTTP URL to its HTTPS version.
What is a 308 redirect?
A permanent redirect like a 301, except that the browser must keep the original request method, such as POST.
How long should I keep 301 redirects?
At least a year after a move, and ideally permanently if old links still point to the old URLs.
Should I redirect deleted pages to the home page?
Not usually. Redirect to the closest relevant page, or return a 404 or 410 if nothing similar exists.
Sources
- Google Search Central: Redirects and Google Search
- Search Engine Journal: How redirects affect ranking signals
- Ahrefs: 301 vs 302 redirects
Last updated: