Referer

The Referer HTTP request header contains an absolute or partial address of the page that makes the request. The Referer header allows a server to identify a page where people are visiting it from. This data can be used for analytics, logging, optimized caching, and more.

When you follow a link, the Referer contains the address of the page that owns the link. When you make resource requests to another domain, the Referer contains the address of the page that uses the requested resource.

The Referer header can contain an origin, path, and querystring, and may not contain URL fragments (i.e. "#section") or "username:password" information. The request's referrer policy defines the data that can be included. See Referrer-Policy for more information and examples.

Note: The header name "referer" is actually a misspelling of the word "referrer". See HTTP referer on Wikipedia for more details.

Warning: This header may has undesirable consequences for user security and privacy. See Referer header: privacy and security concerns for more information and mitigations.

Header type Request header
Forbidden header name yes

Syntax

Referer: <url>

Directives

<url>

An absolute or partial address of the web page that makes the request. URL fragments (i.e. "#section") and userinfo (i.e. "username:password" in "https://username:[email protected]/foo/bar/") are not included. Origin, path, and querystring may be included, depending on the referrer policy.

Examples

Referer: https://developer.mozilla.org/en-US/docs/Web/JavaScript
Referer: https://example.com/page?q=123
Referer: https://example.com/

Specifications

Specification
Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content (HTTP/1.1)
# header.referer

Browser compatibility

BCD tables only load in the browser

See also