murattunalı.
Reading

301 or 302 (and 307/308).

A 301 says an address has moved permanently, while a 302 says it is temporarily somewhere else; permanent moves such as a site redesign, a domain change or the switch to HTTPS use 301 (or 308), and a page that will come back uses 302 (or 307). Google treats a 301 as a strong signal that the target is the canonical address, and a 302 as a weak one.

The two codes seem to do the same thing: in both, the visitor reaches the new address. The difference is a statement of intent, and the ones who listen to that statement most are the search engine and the browser cache. A 301 says “forget the old address”, a 302 says “the old address will be back”. Choosing the wrong code in a redesign does not break the page; it only tells the search engine the wrong thing. That is why the choice of code is a decision written separately for every row in the map of a site redesign and migration project.

307 and 308 are the method-preserving versions of the same pair. With 301 and 302, the HTTP standard allows the browser to turn a form submission into an ordinary page request on the next request; 307 and 308 do not allow this. For ordinary pages the difference does not matter; for forms and application endpoints it does.

The most common mistake is not a conscious choice but a default. Apache’s Redirect directive, Nginx’s return line and Cloudflare’s _redirects file send a 302 when no code is written. A permanent move can look temporary simply because the person writing the configuration forgot the code. The correct lines for each environment are in the 301 redirect guide; the definition of a temporary redirect is in the 302 redirect entry.

We read this site’s server code and measured it live. Every request to the non-www domain goes to the www address with a 301, path unchanged; retired service addresses and one spelling variant are redirected from a small table to their new addresses, again with a 301. There is no 302 and no redirect to a language root in the server code. Forms without a trailing slash and addresses ending in /index.html, on the other hand, are consolidated to the trailing-slash address by the hosting platform with a 307; that redirect carries a temporary code, but the destination page declares itself as canonical. How all of these are consolidated into a single address is in the HTTPS and www redirect guide, the length of the chain in the redirect chain entry.

If you don’t want to lose traffic while relaunching your site, website redesign and migration inventories the old addresses, builds a chain-free 301 map and monitors the site for 90 days after the move.

Criterion

301 · 308 (permanent)

What it says “This address has moved permanently to the new address”

Canonical signal in Google Strong — points to the target as the canonical address

Request method (RFC 9110) 301: the browser may turn a form submission (POST) into a GET on the next request · 308: method and body stay unchanged

Browser cache Heuristically cacheable; a wrong 301 can live on in the visitor’s browser for a while even after it is fixed on the server

302 · 307 (temporary)

What it says “This address is somewhere else for now; the old address remains valid”

Canonical signal in Google Weak — Google also looks at other signals to decide which address is canonical

Request method (RFC 9110) 302: a POST may become a GET · 307: method and body stay unchanged

Browser cache Not cached by default; easy to undo

301 · 308 (permanent)

Where it fits Site redesign, change of URL structure, domain move, switch to HTTPS, www consolidation

If no code is written The default in none of the three configurations examined; 301 or permanent must be written explicitly

Cost of the wrong choice Given to a page that will come back, the old address may drop out of the index and browsers remember the redirect

On this site (23.09.2026) Non-www address → www address and old route aliases: 301 in the server code

302 · 307 (temporary)

Where it fits Maintenance page, time-limited campaign, a page that will come back, a short test

If no code is written Apache Redirect, Nginx return and Cloudflare _redirects send a 302 when written without a code

Cost of the wrong choice Given to a permanent move, the new address is left with only a weak signal that it is the canonical one

On this site (23.09.2026) Forms without a trailing slash and /index.html: the hosting platform’s 307 · no 302 in the server code

FREQUENTLY ASKED QUESTIONS

What is the difference between a 301 and a 302?

A 301 says an address has moved permanently, a 302 that it is temporarily somewhere else. To the visitor both look the same, because in both cases the browser goes to the new address. The difference lies with the search engine: Google reads a 301 as a strong signal that the new address is the canonical one, and a 302 as a weak signal.

Which one should be used when redesigning a site?

301, because the move is permanent, or 308, which carries the same meaning. A site redesign, a change of URL structure, a domain move and the switch to HTTPS are changes that are not expected to be reversed. Every old address should go to its new equivalent in a single step with a permanent redirect.

What happens if a 302 is used for a permanent move?

Google follows the redirect but receives only a weak signal that the target is the canonical address; it decides which address to keep in the index by looking at other signals. If the move really is permanent, the redirect should be changed to a 301. In the three configurations we examined (Apache, Nginx, Cloudflare _redirects) the default is 302 when no code is written, so this mistake is easy to make.

When are 307 and 308 needed?

When the redirected request carries a method other than GET, such as a form submission or an application call. Under the HTTP standard the browser may not change the method and body with 307 and 308; with 301 and 302 a POST request may turn into a GET. For ordinary page addresses there is no difference between 301 and 308 from a search point of view; Google treats both as permanent.

Can a meta refresh or a JavaScript redirect replace a 301?

Partly. Google interprets an instant (0 seconds) meta refresh as a permanent redirect and a delayed one as temporary; it also treats a JavaScript change of location as permanent when the page can be rendered. But both require the page to load first. Where possible, a server redirect always comes first.

SOURCES