Skip to content
Glossary

What is the HTTP Referer header?

Definition

Referer is the HTTP request header that names the page or resource the requested URL was obtained from.

A browser never decides this header case by case. It applies a referrer policy, so the value follows a handful of fixed rules, and a hand-written Referer in a scraper is easy to get wrong in ways no browser would. The name is misspelled, and RFC 9110 keeps the misspelling on purpose, marking the field name with a bracketed sic and spelling “referrer” correctly everywhere else.

What a browser actually sends

We loaded one page in Chrome for Testing 148.0.7778.96 (headless shell) on macOS 26.6.2. The page, http://localhost:38510/article/42?utm_source=x#top, embedded one image from its own origin and one from another. A local server logged the Referer on each request:

localhost:38510 /article/42?utm_source=x   Referer=None
localhost:38510 /same.png                  Referer=http://localhost:38510/article/42?utm_source=x
127.0.0.1:38511 /cross.png                 Referer=http://localhost:38510/

Three rules show in three lines. The navigation itself came from the command line, which has no URL of its own, so no header was sent; RFC 9110 requires a user agent to omit the header or send about:blank in that case. The same-origin request got the full URL, query included and fragment removed. The cross-origin request got the origin alone, with a trailing slash. That is the strict-origin-when-cross-origin policy, which the current Referrer Policy editor’s draft names as the default and which Chrome began rolling out as its default in version 85.

Measured on 21 October 2026, one page load, with two local Python HTTP servers on different ports standing in for two origins. The second origin is 127.0.0.1, so the cross-origin request is also cross-site.

What the policies send

A page can change the policy with a Referrer-Policy response header, a <meta name="referrer"> tag or an attribute on a link. The W3C specification defines eight tokens. “Full URL” below means the URL with fragment, username and password removed; “origin” means scheme, host and port with a trailing slash.

Policy Same origin Cross origin, HTTPS to HTTPS HTTPS to HTTP
no-referrer Nothing Nothing Nothing
no-referrer-when-downgrade Full URL Full URL Nothing
same-origin Full URL Nothing Nothing
origin Origin Origin Origin
strict-origin Origin Origin Nothing
origin-when-cross-origin Full URL Origin Origin
strict-origin-when-cross-origin Full URL Origin Nothing
unsafe-url Full URL Full URL Full URL

One trap when reading the specification: the dated Candidate Recommendation at w3.org/TR/referrer-policy/ predates the change and still gives no-referrer-when-downgrade as the default. The editor’s draft is the version that names strict-origin-when-cross-origin. If a value you see in the wild looks like the older default, it may come from an old client or an explicit page policy rather than a modern browser’s default.

What curl sends

curl sends whatever you give it, with none of the rules applied:

$ curl -s -e "https://www.example.org/search?q=proxies#results" http://localhost:38473/page
Host: localhost:38473
User-Agent: curl/8.7.1
Accept: */*
Referer: https://www.example.org/search?q=proxies#results

That is curl 8.7.1 against a local server that echoes request headers. The fragment went out, which RFC 9110 says a user agent must never do, and no browser would have produced that line. With -L, appending ;auto to the value makes curl set the previous URL as the referrer when it follows a redirect, as its manual describes. Copying a browser’s referrer faithfully means applying the policy yourself: drop the fragment, cut to the origin when you cross origins, and send nothing when you move from HTTPS to HTTP. The curl guide covers the rest of what makes a curl request stand out.

Proxies and scrapers

RFC 9110 records that some intermediaries strip Referer from outgoing requests indiscriminately, which interferes with sites that use it against cross-site request forgery, and says an intermediary should not touch it when it shares the target’s scheme and host. Through CONNECT a proxy cannot see the header at all, because it travels inside the TLS session. On an HTTPS request through a CONNECT tunnel, a missing value is therefore your client’s doing, not the proxy’s.

No client in our default request headers study sent Referer on a first request, the Chromium navigation included, which is what the rules above predict. Send one only when the request claims to follow a link that would have produced it, and keep it consistent with the user agent, the cookies and the order of navigation. It is a weak signal on its own and we make no claim about its effect on any particular target, but an inconsistent value can feed the kind of block described in 403 vs 407 vs 429.

Frequently asked questions

Why is Referer spelled with one r?
The field name was misspelled in an early HTTP specification, and by the time anyone noticed, software everywhere depended on it. RFC 9110 keeps the spelling, marks it with a bracketed sic, and spells the English word referrer correctly in its prose. The Referrer-Policy header, added much later, uses the correct spelling.
Why is the Referer header missing on some requests?
Usually the policy removed it. Browsers send nothing when an HTTPS page links to an HTTP URL, nothing for typed addresses and bookmarks, and a page can choose no-referrer or same-origin for its own links. Through an HTTPS proxy tunnel the proxy cannot see the header, so it cannot have removed it either.
What is the difference between Referer and Origin?
Origin carries only scheme, host and port and is sent on requests such as cross-origin POSTs and CORS requests, where a server needs to know who is asking. Referer can carry a full path and query, is controlled by the referrer policy, and is omitted in more situations.
Should my scraper send a Referer header?
Send one when the request claims to follow a link that would have produced it, and shape it the way the browser's policy would: no fragment, the origin only across origins, nothing on an HTTPS to HTTP step. A value that contradicts the rest of the request is worse than none.

Sources

  1. RFC 9110: HTTP Semantics, section 10.1.3, the Referer header field
  2. W3C Referrer Policy, editor's draft: the eight policy tokens and the strict-origin-when-cross-origin default
  3. W3C Referrer Policy, Candidate Recommendation: the older no-referrer-when-downgrade default
  4. Chrome for Developers: strict-origin-when-cross-origin becomes the default in Chrome 85
  5. curl manual: -e, --referer and the ;auto suffix

All terms, A to Z