The Referer
request header contains the address of the previous web page from which a link to the currently requested page was followed. The Referer
header allows servers to identify where people are visiting them from and may use that data for analytics, logging, or optimized caching, for example.
Important: Although this header has many innocent uses it can have undesirable consequences for user security and privacy. See Referer header: privacy and security concerns for more information and mitigations.
Note that referer is actually a misspelling of the word "referrer". See HTTP referer on Wikipedia for more details.
A Referer
header is not sent by browsers if:
- The referring resource is a local "file" or "data" URI.
- An unsecured HTTP request is used and the referring page was received with a secure protocol (HTTPS).
Header type | Request header |
---|---|
Forbidden header name | yes |
Syntax
Referer: <url>
Directives
- <url>
- An absolute or partial address of the previous web page from which a link to the currently requested page was followed. URL fragments (i.e. "#section") and userinfo (i.e. "username:password" in "https://username:password@example.com/foo/bar/") are not included.
Examples
Referer: https://developer.mozilla.org/docs/Web/JavaScript
Specifications
Specification | Title |
---|---|
RFC 7231, section 5.5.2: Referer | Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content |
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Referer | Chrome Full support Yes | Edge Full support 12 | Firefox Full support Yes | IE Full support Yes | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
Length limited to 4096 bytes | Chrome Full support 77 | Edge Full support 79 | Firefox Full support 70 | IE No support No | Opera Full support 64 | Safari No support No | WebView Android Full support 77 | Chrome Android Full support 77 | Firefox Android No support No | Opera Android Full support 55 | Safari iOS No support No | Samsung Internet Android No support No |
Legend
- Full support
- Full support
- No support
- No support