On a shop website, when "Pay now" is clicked we perform a header redirection to the same URL, just an SSL secured https version.

In such a common scenario, should we use a permanent (301), a temporary (302) or any other status code? Somehow, neither permanent nor temporary feels right (though I guess the latter will be more appropriate).

link|improve this question
2  
Huzzah - 3 conflicting answers (and counting?)... – Mike Hudson Nov 21 '11 at 5:58
Interesting. I thought there would be some kind of a standard. – Olaf Nov 21 '11 at 9:09
feedback

3 Answers

up vote 1 down vote accepted

For more information on response codes, see: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html (or http://urivalet.com/reason-phrases/ for a summary).

To answer your question, and to allay the issues with the 303 response (that some clients don't understand it), you would be safer to stick with a 302.

link|improve this answer
I found the 302 most convincing. Thanks. – Olaf Dec 1 '11 at 14:17
feedback

If you are always redirecting to the SSL site, then a 301 would fit … but you might as well just change the URL you link to instead of redirecting.

link|improve this answer
Can't do that, for various reasons the redirect must happen from code. – Olaf Nov 21 '11 at 9:07
feedback

A 303 See Other may be the most appropriate in this scenario.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.