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 .…