Let's talk about your projectFree discovery callWhatsApp
SEO8 min read404 AjansSeptember 24, 2026Updated: September 24, 2026

301 vs 302 Redirects: What's the Difference and When Should You Use Each for SEO?

301 vs 302 Redirects: What's the Difference and When Should You Use Each for SEO?

A 301 redirect says a page has moved to a new address permanently; a 302 says it is temporarily somewhere else. For SEO, use 301 (or 308) for permanent moves, so Google treats the new URL as canonical and consolidates signals there. Use 302 (or 307) only when the old URL will come back, such as during maintenance or a short campaign.

What is the difference between 301, 302, 307 and 308 redirects?

301, 302, 307 and 308 are HTTP redirect status codes, and they answer two questions: is the move permanent or temporary, and must the browser keep the request method (GET, POST)? 301 and 308 are permanent, 302 and 307 are temporary. 307 and 308 guarantee that the method and body are passed on unchanged.

  • —301 Moved Permanently: The page has a new address and the old one will not be used again.
  • —302 Found: Temporary redirect. The old URL should stay indexed; the content is elsewhere for now.
  • —307 Temporary Redirect: The strict version of 302; a POST stays a POST.
  • —308 Permanent Redirect: The strict version of 301; safe for moving API endpoints that accept form submissions.

Normal page visits are GET requests, so for SEO purposes 301 and 308 behave alike, as do 302 and 307. The difference shows up with forms and APIs: for historical reasons, browsers may turn a POST into a GET when following a 301 or 302.

How does Google treat 301 and 302 redirects?

Google treats a permanent redirect (301, 308) as a strong signal that the target should be canonical, and a temporary redirect (302, 307) as a weak signal. After a 301, the new URL gradually replaces the old one in search results; after a 302, Google usually keeps the old URL indexed. Google has stated that 3xx redirects do not by themselves lose PageRank.

Google may eventually treat a long-standing 302 as permanent, but relying on that is worse than stating your intent with the correct code. Google recommends keeping redirects for moved pages in place for at least a year; in practice, leaving them permanently is safest, because external links and bookmarks keep arriving at the old URL for years.

Which redirect should you use in which situation?

Choosing a redirect type comes down to one question: will the old URL ever come back? If not, use a permanent redirect (301 or 308); if it will return soon, use a temporary one (302 or 307). The situations below are the ones developers run into most often.

  • —Domain change or site migration: 301, mapped page by page.
  • —HTTP to HTTPS, and consolidating www and non-www onto one host: 301.
  • —Slug change or merging two pages: 301 to the closest matching content.
  • —Planned maintenance or a temporary campaign page: 302 or 307.
  • —Automatic redirects by language or location: be careful; Googlebot mostly crawls from the US and may never see other language versions. Prefer a language switcher plus hreflang.
  • —Deleted page with no equivalent: not a redirect but 404 or 410; mass-redirecting to an unrelated page may be treated as a soft 404.

Are meta refresh and JavaScript redirects OK for SEO?

Meta refresh and JavaScript redirects are fallbacks for when a server-side redirect cannot be configured. Google interprets an instant meta refresh as permanent and a delayed one as temporary. A JavaScript redirect is only noticed after the page is rendered, so it is processed later, and bots that do not run JavaScript never see it.

On static hosting without access to server configuration, an instant meta refresh plus a canonical pointing to the target is a reasonable stopgap. When you do have access, always prefer an HTTP-level 301. In single-page apps, redirects inside the router are also client-side JavaScript redirects; as long as the server returns 200, search engines do not see a real 301.

What is a redirect chain and why should you avoid it?

A redirect chain is when a URL passes through several redirects before reaching its final destination, for example http://example.com to https://example.com, then to https://www.example.com, then to the trailing-slash version. Every hop adds latency, Googlebot follows at most 10 hops in one go, and chains waste crawl budget.

  • —Point every old URL directly at its final destination; remove intermediate hops.
  • —Combine protocol, www and trailing-slash rules into a single redirect.
  • —During a new migration, update the old redirect map: turn A to B plus B to C into A to C.
  • —Update internal links, canonical tags and the sitemap to final URLs, not redirecting ones.
  • —Test for loops: A pointing to B and B pointing back to A makes the page unreachable.

How do you build a redirect map for a site migration?

A redirect map is a table, prepared before a site migration, that shows which new URL every old URL will 301 to. The list of old addresses comes from the sitemap, Search Console's performance and page reports, analytics and pages with external links; migrations done without this list easily send traffic-earning pages to 404.

  • —Collect old URLs into one list: sitemap, Search Console, analytics and linked pages.
  • —Write the new target on each row; if there is no exact match, pick the closest topic, and if there is none, record a 404 or 410 decision.
  • —Prioritise pages with traffic and backlinks and test them one by one before launch.
  • —In the weeks after launch, watch Search Console's 404 and redirect reports and add any missing rules.

How do you set up a 301 redirect in .htaccess?

A 301 redirect in .htaccess is set up by adding rule lines to that file in the site's root directory on Apache, or on servers such as OpenLiteSpeed that read .htaccess. The Redirect directive handles single pages; mod_rewrite's RewriteRule handles pattern-based and conditional redirects. After changing rules, purge server and CDN caches and test.

  • —Single page: the line "Redirect 301 /old-page/ https://example.com/new-page/" is enough.
  • —Pattern-based: first "RewriteEngine On", then a rule such as "RewriteRule ^products/(.*)$ /catalog/$1 [R=301,L]".
  • —Forcing HTTPS: a RewriteCond catches requests where HTTPS is off and sends them with a 301 to the same path on https.
  • —Order matters: specific rules must come before general ones and before the SPA fallback rule.
  • —Testing: "curl -I url" shows the status code and Location header; add -L to follow the whole chain.

Without access to server configuration, CDN redirect rules such as Cloudflare's also produce HTTP-level 301s and 302s, and they run before the request ever reaches your server. Whichever layer you choose, keeping all rules in one place prevents conflicts.

Frequently Asked Questions

Does a 301 redirect hurt rankings?+

A correctly mapped 301 does not cause lasting ranking loss; Google has said 3xx redirects do not lose PageRank by themselves. Some fluctuation for a few weeks after a move is normal. Real losses usually come from redirecting pages to unrelated targets or dropping content.

Is it OK to redirect all old pages to the homepage?+

No. Google may treat mass redirects to unrelated pages as soft 404s, and users do not find what they came for. Redirect each old page to the closest matching new page, and return 404 or 410 for pages with no equivalent.

How long should I keep a 301 redirect?+

Google recommends at least a year, but leaving it forever is safest in practice. Links on other sites, old emails and bookmarks keep pointing at the old URL for years, and removing the redirect sends that traffic and link value to a 404 page.

Do browsers cache 301 redirects?+

Yes. Browsers can cache permanent redirects aggressively, so even after you fix a wrong 301, earlier visitors may keep landing on the old target. Test uncertain rules with a 302 first, then switch to 301 once they are verified.

E

Efe TacirlioğluFounder & Lead Developer & UI/UX Designer

Founder of 404 Ajans, based in Istanbul. Builds and designs the agency's web design, e-commerce and custom software projects end to end, drawing on a background in the gaming industry.

Ready to elevate your digital presence?

Let's talk about your project and see what we can build together.

Get in Touch