URL Redirection - Techniques - HTTP Status Codes 3xx

HTTP Status Codes 3xx

In the HTTP protocol used by the World Wide Web, a redirect is a response with a status code beginning with 3 that causes a browser to display a different page. The different codes describe the reason for the redirect, which allows for the correct subsequent action (such as changing links in the case of code 301, a permanent change of address).

The HTTP standard defines several status codes for redirection:

  • 300 multiple choices (e.g. offer different languages)
  • 301 moved permanently
  • 302 found (originally temporary redirect, but now commonly used to specify redirection for unspecified reason)
  • 303 see other (e.g. for results of cgi-scripts)
  • 307 temporary redirect

All of these status codes require that the URL of the redirect target be given in the Location: header of the HTTP response. The 300 multiple choices will usually list all choices in the body of the message and show the default choice in the Location: header.

(Status codes 304 not modified and 305 use proxy are not redirects).

An HTTP response with the 301 "moved permanently" redirect looks like this:

HTTP/1.1 301 Moved Permanently Location: http://www.example.org/ Content-Type: text/html Content-Length: 174

Read more about this topic:  URL Redirection, Techniques

Other articles related to "http status codes 3xx, http":

URL Redirection - Techniques - HTTP Status Codes 3xx - Apache Mod_rewrite
... The Apache HTTP Server's mod_alias extension can be used to redirect certain requests ... look like Redirect permanent /oldpage.html http//www.example.com/newpage.html Redirect 301 /oldpage.html http//www.example.com/newpage.html For more flexible URL rewriting and redirection, Apache ... on RewriteCond %{HTTP_HOST} ^(+.)*oldsite.example.com.?(*)?$ RewriteRule ^(.*)$ http//newsite.example.net/$1 Such configuration can be applied to one or all sites on the server through the server ...

Famous quotes containing the words codes and/or status:

    I cannot help thinking that the menace of Hell makes as many devils as the severe penal codes of inhuman humanity make villains.
    George Gordon Noel Byron (1788–1824)

    The influx of women into paid work and her increased power raise a woman’s aspirations and hopes for equal treatment at home. Her lower wage and status at work and the threat of divorce reduce what she presses for and actually expects.
    Arlie Hochschild (20th century)