Gary Ryan
Gary Ryan

Reputation: 754

What causes a HTTP 302?

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

Upvotes: 10

Views: 46642

Answers (5)

jmarina
jmarina

Reputation: 375

One reason you may get the http 302 code is if you access a https url using http.

In that case, switch to https and it will work.

Upvotes: 2

user2198974
user2198974

Reputation: 21

If you are using CodeIgniter please check url helper and find 302 replace this with 301. This is the main issue for CI based 302 redirects if we use hooks.

Upvotes: 0

Robin Hwang
Robin Hwang

Reputation: 189

It's redirection somewhere of your code may set the limits to that cause the problem in a nutshell, it's all about your code

Upvotes: 4

Sir Crispalot
Sir Crispalot

Reputation: 4854

See the guidance on w3.org.

It's actually a temporary URI redirection. It is also very common to see this when using ASP.NET - performing a server side Response.Redirect() will result in a 302.

Upvotes: 1

Cody Gray
Cody Gray

Reputation: 244981

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.

Upvotes: 14

Related Questions