After reading about redirects, it seems in the majority of cases I should use a 303 see here. So I was wondering if all browsers will support a 303 response, for both normal requests and ajax requests?
The HyperText Transfer Protocol (HTTP) 303 See Other redirect status response code indicates that the redirects don't link to the requested resource itself, but to another page (such as a confirmation page, a representation of a real-world object — see HTTP range-14 — or an upload-progress page).
In PHP you can perform a 303 redirect using header() : header("HTTP/1.1 303 See Other"); header("Location: http://$_SERVER['HTTP_HOST']/new/location/here"); The problem you may face is retaining the form information after the redirect.
303 See Other was standardized as part of HTTP/1.1 which was released in 1999. Essentially all browsers still in use support HTTP/1.1.
Common browsers:
Other browsers:
According to HTTP Methods and Redirect Status Codes, Chrome 13+ supports 303 See Other.
Due to Chrome being released in 2008 and using WebKit (originally), it almost definitely has always supported HTTP/1.1. NOTE: This is an unsubstantiated claim, but I cannot find anything to the contrary.
According to HTTP Methods and Redirect Status Codes, Firefox 6+ supports 303 See Other.
Which browsers can handle Content-Encoding: gzip (found by David Z) indicates HTTP/1.1 is supported by Netscape 6.2+ (Mozilla 0.9.4+) which is the precursor to all Firefox versions.
According to HTTP Methods and Redirect Status Codes, IE 6+ supports 303 See Other.
Django #13277 (mentioned by oDDsKooL) claims IE 4+ is supported, but IE 5-6 have buggy implementations. Upon futher reading, is appears that IE 6 redirection works fine, but displaying a custom error message is buggy.
Which browsers can handle Content-Encoding: gzip (found by David Z) indicates IE 4+ supports HTTP/1.1.
According to HTTP Methods and Redirect Status Codes, Opera 11.5+ supports 303 See Other.
Which browsers can handle Content-Encoding: gzip (found by David Z) indicates Opera 4+ supports HTTP/1.1.
According to HTTP Methods and Redirect Status Codes, Safari 5.1+ supports 303 See Other.
Due to Safari using WebKit which was forked from KHTML in 2001, I assume Safari has always supported HTTP/1.1. NOTE: This is an unsubstantiated claim, but I cannot find anything to the contrary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With