Multiple Choices

several different resources are available

Specification of the HTTP status code 300

The 300 Multiple Choices status code indicates that the target resource has more than one representation, each with its own more specific identifier, and information about the alternatives is being provided so that the user (or user agent) can select a preferred representation by redirecting its request to one or more of those identifiers. In other words, the server desires that the user agent engage in reactive negotiation to select the most appropriate representation(s) for its needs (Section 12).

If the server has a preferred choice, the server SHOULD generate a Location header field containing a preferred choice's URI reference. The user agent MAY use the Location field value for automatic redirection.

For request methods other than HEAD, the server SHOULD generate content in the 300 Multiple Choices response containing a list of representation metadata and URI reference(s) from which the user or user agent can choose the one most preferred. The user agent MAY make a selection from that list automatically if it understands the provided media type. A specific format for automatic selection is not defined by this specification because HTTP tries to remain orthogonal to the definition of its content. In practice, the representation is provided in some easily parsed format believed to be acceptable to the user agent, as determined by shared design or content negotiation, or in some commonly accepted hypertext format.

A 300 Multiple Choices response is heuristically cacheable; i.e., unless otherwise indicated by the method definition or explicit cache controls (see Section 4.2.2 of [CACHING]).

Note: The original proposal for the 300 Multiple Choices status code defined the URI header field as providing a list of alternative representations, such that it would be usable for 200, 300 Multiple Choices, and 406 responses and be transferred in responses to the HEAD method. However, lack of deployment and disagreement over syntax led to both URI and Alternates (a subsequent proposal) being dropped from this specification. It is possible to communicate the list as a Link header field value [RFC8288] whose members have a relationship of "alternate", though deployment is a chicken-and-egg problem.

Source / Quote by: The 300 Multiple Choices HTTP Status Code is specified by section 15.4.1 of RFC9110.


work in progress

How to throw a 300 statuscode with PHP?

To throw the HTTP status code 300 on a web page, the PHP function http_response_code can be used. The syntax is as follows: http_response_code(300) (PHP 5 >= 5.4.0, PHP 7, PHP 8)

Test the 300 HTTP status code

In order to be able to display the HTTP status code (in this case 300 Multiple Choices) and other information on the client side, the development console must be opened with F12. Afterwards you have to navigate to the tab "Network". Now you can open the page, in the network tab you should see the web page (example index.php). This must be selected and then the Herder section must be selected. Here the user will see the following result:

Status code 300 Multiple Choices
URL: https://http-statuscode.com/errorCodeExample.php?code=300
Status: 300 Multiple Choices
Those: Network
IP address: XX.XX.XX.XX
Status code 300 Multiple Choices

Browser compatibility of the 300 status code

Chrome no data
Edge no data
Firefox no data
Opera no data
Safari no data
Chrome Android no data
Firefox for Android no data
Opera Android no data
Safari on iOS no data
Internet no data
WebView Android no data

Constants in programming languages

Author: Tony Brüser
Author: Tony Brüser

Tony Brüser is an enthusiastic web developer with a penchant for HTTP status codes.