Some article I read once said that it means jumping (from one URI to another), but I detected this "302" even when there was actually no jumping at all!
相关问题
- Angular RxJS mergeMap types
- Stop .htaccess redirect with query string
- Google Apps Script: testing doPost() with cURL
- How to instantiate Http service in main.ts manuall
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
相关文章
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
- How to get jQuery.ajax response status?
- send redirect and setting cookie, using laravel 5
- Is there a size limit for HTTP response headers on
- Is a unicode user agent legal inside an HTTP heade
- git: retry if http request failed
- What is the definition of HTTP_X_PURPOSE?
- Flutter - http.get fails on macos build target: Co
According to RFC 1945/Hypertext Transfer Protocol - HTTP / 1.0:
A 302 redirect means that the page was temporarily moved, while a 301 means that it was permanently moved.
301s are good for SEO value, while 302s aren't because 301s instruct clients to forget the value of the original URL, while the 302 keeps the value of the original and can thus potentially reduce the value by creating two, logically-distinct URLs that each produce the same content (search engines view them as distinct duplicates rather than a single resource with two names).
Since June 2014 the RFC 2616 is obsolete and must not be used as reference anymore. The RFC 7231 is the current reference for the semantics and content of the HTTP/1.1 protocol.
A response with
302
is a common way of performing URL redirection. Along with the302
status code, the response should include aLocation
header with a different URI. Such header will be read by the user agent and then perform the redirection:Web browsers may change from
POST
toGET
in the subsequent request. If this behavior is undesired, the307
(Temporary Redirect) status code can be used instead.This is how the
302
status code is defined in the RFC 7231:According to MDN web docs from Mozilla, a typical use case for
302
is:Other status codes for redirection
The RFC 7231 defines the following status codes for redirection:
301
(Moved Permanently)302
(Found)307
(Temporary Redirect)The RFC 7238 was created to define another status code for redirection:
308
(Permanent Redirect)Refer to this answer for further details.
As per the http status code definitions a 302 indicates a (temporary) redirect. "The requested resource resides temporarily under a different URI"
In the term of SEO , 301 and 302 both are good it is depend on situation,
If only one version can be returned (i.e., the other redirects to it), that’s great! This behavior is beneficial because it reduces duplicate content. In the particular case of redirects to trailing slash URLs, our search results will likely show the version of the URL with the 200 response code (most often the trailing slash URL) -- regardless of whether the redirect was a 301 or 302.
From Wikipedia: