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

When to use a 302

If you aren't sure whether a move is temporary, it probably isn't: use a 301.

Common mistakes

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

Last updated: