Handle 301, 302, 307 & Other Redirects like a Pro with these tips from Google’s John Mueller
April 11, 2016
Time and again, SEO community discusses about how Google handles 302 redirects. This is so because a page’s ranking also depends upon how Google handles a 302.
In order to provide some clarity on the same, John Mueller from Google posted on G+ about how Google deals with redirects.
Here’s what he has to say:
“In general, a redirect is between two pages, here called R & S (it also works for pages called https://example.com/filename.asp, or pretty much any URL). Very simplified, when you call up page R, it tells you that the content is at S, and when it comes to browsers, they show the content of S right away. That sounds simple enough, why are there different types of redirects? Let’s take a look at the redirects, and then it’ll be clearer.”
- Server-side redirects (the web-server returns the redirect as soon as you try to access a page, the user never sees any of the content of page R):
301 permanent redirect: The server tells us that nothing will change its mind about this redirect. Just use “S” in the future, you can cache it like that. Search engines tend to index the content under “S”, and forward any signals from R to S. Useful when you change your site’s URLs for good (site moves, restructures, switching to HTTPS), well, at least until you find a new permanent home for them.
302 temporary redirect: Like the name says, this might not be that permanent. It might change in the future; it might change depending on who accesses it, on the device used, or the user’s location.
- You can’t cache this. Search engines tend to index the content (and keep all signals) under “R”, since it’s unsure that it’ll always redirect to “S.” This is useful for redirecting from the root URL to a lower-level page (“/” -> “/fancycms/mainpage.php”), and for redirects that depend on the user’s country, device, or language settings.
- Client-side redirects (the web-server returns content for both R & S, but the browser recognizes the redirect):
307 redirects: Wait, isn’t this a server-side redirect? No, this is actually your browser trolling you. If you set up HTTPS, 301 redirect from HTTP to HTTPS, and enable HSTS, when you try to access the HTTP version in your browser, it’ll automatically access the HTTPS version, but record it as a 307 redirect. The 307 is a lie :).
- What about Page Rank? It’s simple, either the search engine indexes the content with its signals under R or under S, it doesn’t matter which type of redirect you use.
- What about 303? 304.5? If you have strong feelings about one of the other kinds of redirects, feel free to use them. We’ll have to figure out which URL to index the content under, so if you have strong feelings about that too, make sure to follow up with other canonicalization signals.
How many redirects can you do at the same time? We follow up to 5 in a chain (please keep any redirect chain as short as possible), but you can redirect as many URLs on your site as you want at the same time.”
Do you agree with everything Mueller has suggested handling these redirects? Start the discussion now.