301 vs 302 Redirects: Which One Should You Use?

When to use a 301, 302, 307 or 308 redirect, how Google treats each one, and copy-paste .htaccess rules for Apache and LiteSpeed.

301 vs 302 Redirects: Which One to Use – Techono guide cover

Quick answer: Use a 301 when a page has moved for good. Use a 302 when the move is temporary and the old address will come back. Google treats a permanent redirect as a strong sign that the new URL should show in search. A temporary redirect usually keeps the old URL in search.

The four redirect codes

  • 301 Moved Permanently: the normal choice for moved pages, HTTP to HTTPS, and domain changes.
  • 308 Permanent Redirect: like 301, but forms keep their data. Google treats it like a 301.
  • 302 Found: temporary. Use it for short sales pages, maintenance, or tests.
  • 307 Temporary Redirect: like 302, but forms keep their data.

When to use which

  • Moved or renamed a page: 301
  • Moved to HTTPS or to a new domain: 301
  • Joined two pages into one: 301 to the page that stays
  • Product out of stock for a week: 302, or better, keep the page live
  • Seasonal page that comes back next year: 302

Copy-paste rules for .htaccess

These work on Apache and LiteSpeed. Put them above the # BEGIN WordPress block. Make a backup first: one typo can cause an error 500.

One page

Redirect 301 /old-page/ https://example.com/new-page/

Force HTTPS and remove www

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^ https://example.com%{REQUEST_URI} [L,R=301]
</IfModule>

This sends every old address to the final HTTPS address in one hop, instead of two.

Mistakes to avoid

  • Redirect chains. A → B → C is slow and wastes crawling. Point A straight to C.
  • Sending everything to the homepage. Google may treat this as a “soft 404”. Redirect to the closest matching page, or let the page return 404 or 410.
  • Using 302 for a permanent move. The old URL may stay in Google for months.
  • Redirect loops. Two rules that point at each other. Browsers show “too many redirects”.
  • Removing redirects too soon. Keep them for at least a year. Old links and bookmarks still use them.

Check it with our free tools: Redirect Checker · .htaccess Redirect Generator

Sources

Jonathan

More from the SimpliCloud Blog

XML Sitemaps: What to Include and How to Fix Common Errors

XML Sitemaps: What to Include and How to Fix Common Errors

What belongs in an XML sitemap, the 50,000 URL limit, which fields Google ignores, and how to fix redirects, 404s and noindex pages in your sitemap.

How to Write Title Tags and Meta Descriptions That Get Clicks

How to Write Title Tags and Meta Descriptions That Get Clicks

A simple formula for page titles and meta descriptions, good and bad examples, and why Google sometimes rewrites them.

Robots.txt vs Noindex: How to Keep a Page Out of Google

Robots.txt vs Noindex: How to Keep a Page Out of Google

Robots.txt controls crawling, noindex controls indexing. Learn which one removes a page from Google, with copy-paste examples for WordPress and PDFs.

Need a Tool We Don’t Have?

Tell us what you check on your sites every week. The most-requested tools get built first.