The 302 status code is a bit ambiguous in meaning. It indicates that a resource is “temporarily” moved.
In practice,
it is worth dividing them into internal temporary redirects, that is, from a page on domain A to another page on domain A, and external temporary redirects, from a page on domain A to a page on
domain B.
Browsers always abide by the definitions for interpreting a 302 redirect — both internal and external.However, today, most search engines (Google and Yahoo! included) only use it for an internal 302. For
an internal 302 redirect, then, search engines will not cache the result of the redirect, and continue to list domain A in the SERPs. This is consistent with the definition.
External 302 redirects are more of a problem. More than 99% of the time,Google will list the result with the destination result, that is, domain B, instead of domain A. This is against
the standard, and Google behaves like this to mitigate a vulnerability called “302 hijacking.”302 hijacking refers to the practice of using a page on domain A to link to a page on domain B, which
has fresh quality content. Typically, that page would rank well based on that “stolen” fresh content from domain B, and employ a form of cloaking to redirect users to another page. This practice became
prevalent enough to warrant a change in policy from both Google and Yahoo!, And Google is moving to a set of heuristics that return the destination page more than 99% of the time. Why
not 100% of the time? Most search engines reserve the right to make exceptions when we think the source page will be better for users, even though we’ll only do that rarely.”
In this case, the RFC definition is not the rule — it is the exception!
For the most part, external 302s are treated as 301s, but they do not affect the transference of link equity.In practice, on a dynamic site, you should evaluate whether 302s are necessary anyway. If you want a URL
to host some different content than the usual temporarily, it is better to change the content transparently.Possible implementations include using an include(), or fetching and displaying the alternative content
remotely, obviating the need for the 302 in the first place. To do this you can use the cURL functions in PHP — Client URL Library.
Redirection Using 302
The 302 codes are the HTTP status codes used for redirection. These codes indicate that another request must be made in order to fulfill the HTTP request — the content is located elsewhere. When a web
page replies with either of these codes, it does not return any HTML content, but includes an additional Location: HTTP header that indicates another URL where the content is found.