Forum Moderators: open

Message Too Old, No Replies

302 "Moved Temporarily"and 302 "Found" staus codes!?

Is there any difference from SEO point of view?

         

wildbest

11:58 am on Apr 25, 2009 (gmt 0)

10+ Year Member



I've seen different text to 302 HTTP Status Code in some server headers. For instance, in Apache mode_rewrite...

If I redirect fully qualified URL using flag [R=302,L] most of server header checking tools I use will return 302 "Moved Temporarily" but if I use only [L] (redirection is by default when http is used) then 302 "Found" is returned.

From SEO point of view, is there any difference between "302 Moved Temporarily" and "302 Found" status codes? And what's the difference between "302 Moved Temporarily" and "307 Redirect Temporarily"?

jdMorgan

3:02 pm on Apr 25, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The text that accompanies a server status response code really doesn't matter unless the client is programmed to interpret it -- which would be a mistake. So most clients rely only on the status code 'number' itself.

Therefore, there's no difference in the meaning of the two 302 messages you listed to properly-implemented clients.

302-Found means that the client-requested resource can be found at a different URL than the one at which it was initially requested. Because it was used historically for various purposes, it no longer carries any other semantic meaning. It would be an error to say that it still means "Moved Temporarily" -- All it really means is "Moved."

Since the HTTP/1.0 302 response was used for various unforeseen purposes and became ambiguous, the 307-Moved Temporarily response code was added to HTTP/1.1 along with 303-See Other, so that servers can now specify that the requested resource is -- 301-Moved Permanently, 302-Found (relocated for unspecified reason), 303-See Other (meaning "go there" without any other meaning and usually served as a response to a POST, for example), and 307-Moved Temporarily.

The confusion over the meaning of the 302 response resulted from the evolution of the HTTP protocol over time. But along with the response code changes listed above, HTTP/1.1 introduced the "Host" request header, without which named-based shared virtual hosting would be impossible. Every Webmaster should consider reading the RFC-2616 HTTP/1.1 HyperText Transfer Protocol specification [w3.org] at least once, since it defines the underpinning of every site and transaction on the Web. An awful lot of confusion about redirects and other client-server interactions can be avoided by reviewing this fundamental document.

And for those who are considering how to properly design URLs for resources on their sites, a review of RFC2396 - Uniform Resource Identifiers (URI): Generic Syntax [faqs.org] is well worthwhile. While it's a bit heavy, it defines which characters are allowed in which parts of URLs and query strings, and can save Webmasters from making fundamental mistakes which may prove to be costly later.

Jim

wildbest

8:30 pm on Apr 25, 2009 (gmt 0)

10+ Year Member



Thank you very much indeed, Jim. As always - admiration and inspiration. :)

The text that accompanies a server status response code really doesn't matter unless the client is programmed to interpret it -- which would be a mistake. So most clients rely only on the status code 'number' itself.

I'd be very careful to that asumption, because it looks like Google crawlers are programmed to interpret the text!

For several months I've used redirect by default in Apache mod_rewrite that returns "302 Found" status code. But 48 hours after I switched to PHP header("HTTP/1.1 302 Moved Temporarily"), my sitemap.xml in Google's WMT flashed with a big red warning that some of sitemap-ed URLs are "Moved Temporarily" and should be excluded from the sitemap!

Actually, I'm not sure what's going on? Because in the "Moved Temporarily" case you may get a warning before the downgrade, while in the case of "302 Found" you might be downgraded without any warning?!...

BTW, is there any way I can send 404 status code along with redirecting client to external URL (http:// or [)?...] I know, I know... It's impossible to send both 302 and 404, but who knows? Your Apache bag of tricks is really large! :)

g1smd

8:40 pm on Apr 25, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



A URL request can return only one status code. Codes like 200 and 404 are final.

If the status code indicates a redirect then the browser should make a new request for the new URL.

That new request can return only one status code.