Referer Header

Table of Content

  • Syntax
  • Directives
  • Examples
  • Browser Compatibility
  • How to modify Referer header The Referer HTTP header plays a crucial role in request protocols, offering visibility into the previous page from where the request is originated. It's beneficial in analytics, logging, or browser caching, enabling websites to track different sources of web traffic, boost security by identifying suspicious request patterns, and optimize content.

Syntax

Referer: <url>

Directives

The Referer header entails only one directive which is the URL from which the user-agent accessing the web page, or the URL of the web resource.

The webpage’s URL is provided after Referer: in the HTTP header, describing the source of the HTTP request.

Examples

If a user clicks a hyperlink on https://example.com, that leads them to https://another-example.com, the latter would receive a request header of this format:

GET / HTTP/1.1
Referer: https://example.com

Browser Compatibility

Browser Compatibility
Chrome Supported
Firefox Supported
Safari Supported
Opera Supported
Edge Supported

Hereby, we see that virtually all modern browsers support the Referer HTTP header.

How to modify Referer header

ModHeader is a Chrome extension that allows you to modify and customize your HTTP requests, which includes the manipulation of the Referer header.

Follow the steps below to modify Referer header:

  1. Install the extension on your browser.
  2. Click on the ModHeader icon in your toolbar to launch it.
  3. In the "Request headers" section, input "Referer" in the "Name" field.
  4. In the adjacent "Value" field, input the required URL you wish to set as the new referer.

Thus, we can easily use ModHeader to spoof the referer for testing purposes, and reproduce and resolve bugs related to HTTP requests.