Spec-Zone.ru › HTTP

Headers: Referer

Referer header

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

  • Learn more
  • See full compatibility
>

The HTTP Referer 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 Referrer-Policy for more information and examples.

The Referer should also be sent in requests following a 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 Request header
Forbidden request header 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 user info (i.e., username:password in https://username:password@example.com/foo/bar/) are not included. Origin, path, and query string 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
HTTP Semantics>
# field.referer>

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
Referer 1 12 1 15 1 18 4 14 1 1.0 4.4 1
length_limit_4096B 77 79 70 64 14 77 79 55 14 12.0 77 14

See also

  • Referrer-Policy
  • Same-origin policy
  • Fetch: Request.referrerPolicy
  • Tighter Control Over Your Referrers – Mozilla Security Blog
  • HTTP referer on Wikipedia

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Referer

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API