Recent from talks
Contribute something
Nothing was collected or created yet.
HTTP referer
View on Wikipedia| HTTP |
|---|
| Request methods |
| Header fields |
| Response status codes |
| Security access control methods |
| Security vulnerabilities |
In HTTP, "Referer" (a misspelling of "Referrer"[1]) is an optional HTTP header field that identifies the address of the web page (i.e., the URI or IRI) from which the resource has been requested. By checking the referrer, the server providing the new web page can see where the request originated.
In the most common situation, this means that when a user clicks a hyperlink in a web browser, causing the browser to send a request to the server holding the destination web page, the request may include the Referer field, which indicates the last page the user was on (the one where they clicked the link).
Web sites and web servers log the content of the received Referer field to identify the web page from which the user followed a link, for promotional or statistical purposes.[citation needed] This entails a loss of privacy for the user and may introduce a security risk.[2] To mitigate security risks, browsers have been steadily reducing the amount of information sent in Referer. As of March 2021, by default Chrome,[3] Chromium-based Edge, Firefox,[4] Safari[5] default to sending only the origin in cross-origin requests, stripping out everything but the domain name.
Etymology
[edit]The misspelling of referrer was introduced in the original proposal by computer scientist Phillip Hallam-Baker to incorporate the "Referer" header field into the HTTP specification.[6][7] The misspelling was set in stone by the time (May 1996) of its incorporation into the Request for Comments standards document RFC 1945[8] (which 'reflects common usage of the protocol referred to as "HTTP/1.0"' at that time); document co-author Roy Fielding remarked in March 1995 that "neither one (referer or referrer) is understood by" the standard Unix spell checker of the period.[9] "Referer" has since become a widely used spelling in the industry when discussing HTTP referrers; usage of the misspelling is not universal, though, as the correct spelling "referrer" is used in some web specifications such as the Referrer-Policy HTTP header or the Document Object Model.[2]
Details
[edit]When visiting a web page, the referrer or referring page is the URL of the previous web page from which a link was followed.
More generally, a referrer is the URL of a previous item which led to this request. For example, the referrer for an image is generally the HTML page on which it is to be displayed. The referrer field is an optional part of the HTTP request sent by the web browser to the web server.[10]
Many websites log referrers as part of their attempt to track their users. Most web log analysis software can process this information. Because referrer information can violate privacy, some web browsers allow the user to disable the sending of referrer information.[11] Some proxy and firewall software will also filter out referrer information, to avoid leaking the location of non-public websites. This can, in turn, cause problems: some web servers block parts of their website to web browsers that do not send the right referrer information, in an attempt to prevent deep linking or unauthorised use of images (bandwidth theft). Some proxy software has the ability to give the top-level address of the target website as the referrer, which reduces these problems but can still in some cases divulge the user's last-visited web page.
Many blogs publish referrer information in order to link back to people who are linking to them, and hence broaden the conversation. This has led, in turn, to the rise of referrer spam: the sending of fake referrer information in order to popularize the spammer's website.
It is possible to access the referrer information on the client side using document.referrer in JavaScript.[12] This can be used, for example, to individualize a web page based on a user's search engine query. However, the referrer field does not always include search keywords, such as when using Google Search with HTTPS.[13]
Referrer hiding
[edit]Most web servers maintain logs of all traffic, and record the HTTP referrer sent by the web browser for each request. This raises a number of privacy concerns, and as a result, a number of systems to prevent web servers being sent the real referring URL have been developed. These systems work either by blanking the referrer field or by replacing it with inaccurate data. Generally, Internet-security suites blank the referrer data, while web-based servers replace it with a false URL, usually their own. This raises the problem of referrer spam. The technical details of both methods are fairly consistent – software applications act as a proxy server and manipulate the HTTP request, while web-based methods load websites within frames, causing the web browser to send a referrer URL of their website address. Some web browsers give their users the option to turn off referrer fields in the request header.[11]
Most web browsers do not send the referrer field when they are instructed to redirect using the "Refresh" field. This does not include some versions of Opera and many mobile web browsers. However, this method of redirection is discouraged by the World Wide Web Consortium (W3C).[14]
If a website is accessed from a HTTP Secure (HTTPS) connection and a link points to anywhere except another secure location, then the referrer field is not sent.[10]
The HTML5 standard added support for the attribute/value rel="noreferrer", which instructs the user agent to not send a referrer.[15]
Another referrer hiding method is to convert the original link URL to a Data URI scheme-based URL containing small HTML page with a meta refresh to the original URL. When the user is redirected from the data: page, the original referrer is hidden.
Content Security Policy standard version 1.1 introduced a new referrer directive that allows more control over the browser's behaviour in regards to the referrer header. Specifically it allows the webmaster to instruct the browser not to block referrer at all, reveal it only when moving with the same origin etc.[16]
References
[edit]- ^ Gourley, David; Totty, Brian; Sayer, Marjorie; Aggarwal, Anshu; Reddy, Sailu (27 September 2002). HTTP:The Definitive Guide. "O'Reilly Media, Inc.". ISBN 9781565925090.
- ^ a b "Does your website have a leak?". ICO Blog. 2015-09-16. Archived from the original on 2018-05-24. Retrieved 2018-08-16.
- ^ "Referrer Policy: Default to strict-origin-when-cross-origin - Chrome Platform Status". www.chromestatus.com. Retrieved 2021-03-23.
- ^ Lee, Dimi; Kerschbaumer, Christoph (22 March 2021). "Firefox 87 trims HTTP Referrers by default to protect user privacy". Mozilla Security Blog. Retrieved 2021-03-23.
- ^ Wilander, John (2019-12-10). "Preventing Tracking Prevention Tracking". WebKit blog.
- ^ Hallam-Baker, Phillip (2000-09-21). "Re: Is Al Gore The Father of the Internet?". Newsgroup: alt.folklore.computers. Retrieved 2013-03-20.
- ^ Hallam-Baker, Phillip. "Re: Referer: (sic)". W3C Public mailing list archives. Archived from the original on 2024-02-19. Retrieved 19 February 2024.
- ^ Berners-Lee, T.; Fielding, R.; Frystyk, H. (May 1996). Hypertext Transfer Protocol -- HTTP/1.0. IETF. doi:10.17487/RFC1945. RFC 1945.
- ^ Fielding, Roy (1995-03-09). "Re: referer: (sic)". ietf-http-wg-old (Mailing list). Retrieved 2013-03-20.
- ^ a b Fielding, R.; Reschke, J. (June 2014). Fielding, R.; Reschke, J. (eds.). Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content: referrer (RFC 7231 § 5.5.2). IETF. sec. 5.5.2. doi:10.17487/RFC7231. S2CID 14399078. RFC 7231. Retrieved 2014-07-26.
- ^ a b "Network.http.sendRefererHeader". MozillaZine. 2007-06-10. Retrieved 2015-05-27.
- ^ "HTML DOM Document referrer Property". W3Schools. Retrieved 2013-03-20.
- ^ Gundersen, Bret (2011-10-19). "The Impact of Google Encrypted Search". Adobe Digital Marketing Blog. Retrieved 2021-03-17.
- ^ "HTML Techniques for Web Content Accessibility Guidelines 1.0: The META element". W3C. 2000-11-06. Retrieved 2013-03-20.
- ^ "4.12 Links — HTML Living Standard: 4.12.5.8 Link type "noreferrer"". WHATWG. 2016-02-19. Retrieved 2016-02-19.
- ^ "Content Security Policy Level 2". W3. 2014. Retrieved 2014-12-08.
External links
[edit]HTTP referer
View on GrokipediaReferer = absolute-URI / partial-URI, where it is sent only in requests (not responses) and is case-insensitive, though implementations typically use "Referer".[1] Despite its utility in web analytics and anti-bot measures, evolving privacy regulations like GDPR and browser features such as Intelligent Tracking Prevention have led to reduced reliance on Referer data, with alternatives like the Fetch Metadata Request Headers providing safer context without full URL exposure.[3] Overall, while the Referer remains a core part of HTTP semantics, its use is increasingly balanced against user privacy protections in contemporary web development.
Origins and Etymology
Etymology
The HTTP "Referer" header derives its name from a misspelling of the standard English term "referrer," which denotes the source providing a reference or directing a user to another resource. This typographical error occurred in the initial proposal for the header by computer scientist Phillip Hallam-Baker, who suggested incorporating the field into the HTTP specification. Hallam-Baker later acknowledged responsibility for the error in a 1995 IETF mailing list discussion, noting that he had suggested the field without initially naming it, and Roy Fielding proposed the misspelled "Referer" as the header name.[4] The misspelling persisted into the formal HTTP/1.0 specification published as RFC 1945 in 1996, where it was defined without correction due to emerging implementations already adopting the term. Subsequent standards, including HTTP/1.1 in RFC 2616 (1999) and later revisions, retained "Referer" to ensure backward compatibility with existing web infrastructure, avoiding disruptions to deployed systems. Early contributors from the IETF working group, including Tim Berners-Lee, prioritized protocol stability over orthographic accuracy, solidifying the non-standard spelling across the web ecosystem. Linguistically, "referer" functions as a back-formation from "referral," treating the header as an agent of the referral process, but it deviates from conventional English morphology where "referrer" preserves the double 'r' from the verb "refer" (as in "programmer" from "program"). This irregularity mirrors other technical terms where variant spellings have become entrenched, such as "advisor" (American English) versus "adviser" (British English), both accepted despite differing conventions.[5] The persistence of "referer" underscores how protocol design often favors practical consistency over linguistic precision in computing standards.Historical Development
The HTTP referer header was first introduced as an optional request header in the HTTP/1.0 specification, although it first appeared in early HTTP drafts, including the W3C request headers specification updated on May 3, 1994,[6] outlined in RFC 1945 and published in May 1996. Defined in Section 10.13, it specified the URI of the originating resource—typically from a hyperlink or form submission—to assist servers in generating back-links, logging navigation patterns, optimizing caching, and tracing issues like obsolete links. The header's syntax allowed for absolute or relative URIs, though fragments were excluded, and it was not required for requests lacking a clear origin, such as direct keyboard input. Authors Tim Berners-Lee, Roy T. Fielding, and Henrik Frystyk Nielsen emphasized user control over its transmission due to early privacy considerations.[7] The header persisted without alteration in the HTTP/1.1 specification, formalized in RFC 2616 and published in June 1999, maintaining its role in enabling server-side analysis while recommending against its use in non-secure requests following secure ones to protect sensitive URIs. During the mid-1990s, initial browser support emerged with implementations in early web clients like Netscape Navigator (version 1.0 released in December 1994) and successors, aligning with the growing adoption of HTTP for hypermedia systems. In the late 1990s, the referer became instrumental in rudimentary web analytics, as server log analyzers such as Analog (launched in 1995) parsed it to track referral sources and user paths on nascent websites.[8][9][10] By the early 2000s, growing recognition of privacy risks—such as unintended disclosure of browsing history or secure site details—prompted partial browser implementations, including options to suppress or strip the header in cross-protocol transitions (e.g., HTTPS to HTTP). This evolution culminated in the 2014 update via RFC 7231, which redefined HTTP/1.1 semantics across multiple documents but retained the referer header's name and function unchanged for backward compatibility, despite ongoing discussions within the IETF HTTP Working Group about potential renaming to "referrer" that were ultimately rejected to avoid breaking existing systems. The specification reiterated safeguards, advising against its inclusion in downgraded security contexts.[11][12]Technical Functionality
Header Syntax and Values
The Referer header field follows the general HTTP header syntax, consisting of the field name "Referer" followed by a colon and a space, then the field value as a URI reference that identifies the referring resource from which the request originated.[13] The value adheres to the URI-reference production defined in RFC 3986, allowing either an absolute URI or a partial URI (relative reference). This structure enables servers to contextualize requests without requiring a full URL in all cases.[13] Possible values for the Referer header include absolute URLs, such ashttps://example.com/page.html, which specify the complete scheme, host, path, and optional query parameters.[13] Partial URIs, like /path/to/resource?query=value, represent relative paths from the same origin, omitting the scheme and authority components.[13] An empty value or omission of the header indicates no referrer information is provided, often due to policy or lack of a referring context.[13]
Encoding rules for the Referer value require percent-encoding of special characters as per URI syntax in RFC 3986; for instance, spaces are encoded as %20, and non-ASCII characters use UTF-8 percent-encoding. Query parameters are included if present in the referring URI, but the fragment identifier (e.g., #section) must not be sent, as it is client-side and irrelevant to the server.[13] This ensures the value remains a valid, parsable reference without extraneous components.
In edge cases involving HTTPS origins requesting mixed content over HTTP, user agents SHOULD NOT send the Referer header to prevent leakage of secure URL details.[14] For invalid or malformed values, such as non-URI strings, HTTP servers handle them as opaque strings per general field parsing rules, often ignoring or logging them without error.
The formal grammar for the Referer header, as specified in RFC 9110 (which obsoletes RFC 7231), is given in Augmented Backus-Naur Form (ABNF) below:
Referer = absolute-URI / partial-URI
absolute-URI = scheme ":" hier-part [ "?" query ]
partial-URI = relative-part [ "?" query ]
Referer = absolute-URI / partial-URI
absolute-URI = scheme ":" hier-part [ "?" query ]
partial-URI = relative-part [ "?" query ]
query, hier-part, relative-part) and RFC 3986 for complete URI components.[13]