docs.rodeo

MDN Web Docs mirror

Referer

{{HTTPSidebar}} 

The HTTP Referer {{Glossary("request header")}}  contains the absolute or partial address from which a resource has been requested. The Referer header allows a server to identify referring pages that people are visiting from or where requested resources are being used. This data can be used for analytics, logging, optimized caching, and more.

When you click a link, the Referer contains the address of the page that includes 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 {{HTTPHeader("Referrer-Policy")}}  for more information and examples.

The Referer should also be sent in requests following a {{httpheader("Refresh")}}  response (or equivalent <meta http-equiv="refresh" content="...">) that causes a navigation to a new page, if permitted by the referrer policy.

[!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 have undesirable consequences for user security and privacy. See Referer header: privacy and security concerns for more information and mitigation hints.

Header type `{{Glossary("Request header")}}` 
`{{Glossary("Forbidden header name")}}`  Yes

Syntax

Referer: <url>

Directives

Examples

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

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN