ArticleslgStudy

science

HTTP referer

HTTP referer is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand HTTP referer rather than just read about it. In short: In HTTP, "Referer" (a misspelling of "Referrer") 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.

HTTP referer — main illustration
HTTP referer — illustration

Key takeaways

  • HTTP referer belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect HTTP referer to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of HTTP referer from memory before moving on to harder problems.

Reference excerpt

In HTTP, "Referer" (a misspelling of "Referrer") 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. This entails a loss of privacy for the user and may introduce a security risk. To mitigate security risks, browsers have been steadily reducing the amount of information sent in Referer. As of March 2021, by default Chrome, Chromium-based Edge, Firefox, Safari default to sending only the origin in cross-origin requests, stripping out everything but the domain name.

Etymology 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. The misspelling was set in stone by the time (May 1996) of its incorporation into the Request for Comments standards document RFC 1945 (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. "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.

Details 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. 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. 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. 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.

Referrer hiding 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. 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). 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. The HTML5 standard added support for the attribute/value rel="noreferrer", which instructs the user agent to not send a referrer. 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.

References

External links

RFC 1945: Hypertext Transfer Protocol -- HTTP/1.0 RFC 7231: Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content RFC 3987: Internationalized Resource Identifiers (IRIs) Referrer Policy - W3C Editor's Draft

Illustrations

HTTP referer illustration

Worked examples

Example 1 — a first encounter with HTTP referer

Start with the simplest possible case. Write down what HTTP referer claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to HTTP referer before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about HTTP referer ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of HTTP referer

In research
HTTP referer appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses HTTP referer in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
HTTP referer is common in secondary-school and first-year university syllabi. It links to neighbouring topics Hypertext Transfer Protocol headers, Nonstandard spelling, URI schemes, so understanding it makes those chapters shorter.
In everyday life
Look for HTTP referer outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “HTTP referer” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study HTTP referer in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what HTTP referer means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain HTTP referer out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is HTTP referer in simple terms?

In HTTP, "Referer" (a misspelling of "Referrer") 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.

Why does HTTP referer matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study HTTP referer?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on HTTP referer.

Tags

  • Hypertext Transfer Protocol headers
  • Nonstandard spelling
  • URI schemes
  • URL

Keep exploring