Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What causes a HTTP 302?

Tags:

http

header

The question is in the title - what causes a HTTP 302?

like image 203
Gary Ryan Avatar asked Mar 25 '11 10:03

Gary Ryan


People also ask

How do I fix error code 302?

You can follow these five steps to fix HTTP 302 errors on your website: Determine whether the redirects are appropriate or not by examining the URLs that are issuing the 302 redirects. Check your plugins to make sure any redirect settings are valid. Ensure that your WordPress URL settings are configured correctly.

How does a 302 redirect work?

A 302 redirect does not pass the “juice,” or keep your domain authority to its new location. It simply redirects the user to the new location for you so they don't view a broken link, a 404 not found page, or an error page.


1 Answers

It's a redirection, not an error. RFC2616 describes it as indicating:

The requested resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client SHOULD continue to use the Request-URI for future requests.

Note that you should only use HTTP 302 redirects for temporary redirections, not permanent ones. Permanent redirections should be implemented using an HTTP 301, instead.

You can avoid it by not issuing an HTTP 302 redirect in your code.

Find more information in the Wikipedia article, and in the answers to this related question.

like image 169
Cody Gray Avatar answered Sep 28 '22 02:09

Cody Gray