Menu

301 vs. 302 Redirects: How Search Engines Treat a URL Change, Measured on This Blog
📰

301 vs. 302 Redirects: How Search Engines Treat a URL Change, Measured on This Blog

DEV Community: php·Susumu Takahashi·6 days ago
#AOJhOV9m
#devto#dev#wordpress#wpmm#redirect
Reading 0:00
15s threshold

Sooner or later every site changes a URL: a cleaner slug, a move to HTTPS, a new domain or subdomain. Each time, the same question comes up: should the redirect be a 301 or a 302?

I covered HTTP status codes in general in " HTTP Status Code Basics ." This article narrows in on 301 and 302: how search engines interpret each one, and which redirects WordPress already sends on its own. The examples come from running curl against this blog.

A redirect is "don't look here, look there"

A redirect response has two parts: a status code that describes the nature of the move, and a Location header that says where to go.

HTTP/2 301 location: https://wpmm.jp/blog/

Enter fullscreen mode

Exit fullscreen mode

For a visitor, a 301 and a 302 look identical: the browser simply follows Location .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.