Skip to content
EUID Audit service & seal, Home
Get your website audited

This translation has not been editorially reviewed yet. The German version is authoritative. Deutsche Fassung

Indexing

301 or 302: Which redirect is the correct one?

301, if the old address is forever replaced by the new one; 302 when she returns. The standard HTTP calls 301 "Moved Permanently", permanently moved, and describes 302 as the address under which the content is temporary. Google is based on this: After a permanent forwarding, it shows the new address in the search result, after a temporary further the old one. For relocation, relaunch, https and the spelling with or without www fits 301, for temporary promotions and tests 302.

The standard distinguishes permanently and temporarily

RFC 9110 defines the meaning. At 301, the content has a new permanent address, and future references should use it. At 302, the content is temporarily under another address; the original remains the valid one. In addition, there are 308 and 307 with the same meanings, permanent and temporary. The difference is evident with forms: At 301 and 302, a browser may for historical reasons turn a submitted form input (POST) into a simple retrieval (GET). The standard refers to 308 and 307 for this case, where the type of request is preserved. For ordinary page views, this makes no difference; for order and registration forms, 307 and 308 are the right choice.

Google shows the destination after 301, after 302 the starting address

Google describes the difference in its guide to redirects. A permanent forwarding evaluates it as a signal that the destination should be the authoritative address, and the destination appears in the search result. A temporary forwarding does not evaluate it that way and shows the output address. In the overview of status codes, Google calls 301 and 308 a strong signal, 302, 303 and 307 a weak signal. Google recommends permanent forwarding to the server whenever possible and it is determined that it will not be taken back. A move set up with 302 arrives with visitors just as well; Google does not read that the new address should apply.

A 301 response browsers can remember

The standard allows browsers and caches to store a 301 response, even without explicitly specifying the server; The same applies to 308. For 302 and 307 it does not provide for this without indication. A visitor who was redirected once with 301 can land directly at the destination next time without your server being asked. This makes the permanent forwarding fast and a persistent error: A wrong set 301 can be changed on the server, it can remain stored in the browsers of your visitors. Therefore, check a new rule at a single address before it applies to the entire website.

Which case needs which code

Permanent and thus 301 are: the new address after relocation or relaunch, the change from http to https, the uniform spelling with or without www, the merging of several pages into one. Temporary and thus 302 are: an action page that replaces the product page for a few weeks, and tests in which some of the visitors see a variant. For such tests, Google calls 302 specifically so that the original address remains in the index, and advises to end the test as soon as the result is determined. If the action ends, remove the forwarding again.

More on this topic

Deutsche Fassung dieser Seite

  • Seal Digitale Barrierefreiheit
  • Seal Daten & Recht
  • Seal Technische Qualität
  • Seal Digital Excellence
  • Seal Cyberversicherung

Audited. For a better digital future.euid.com