HeaderDial › Guides

How to change or remove the Referer header

To change the Referer header in Chrome, Edge or Firefox, add a request header named Referer in HeaderDial, give it the full URL you want the server to see (for example https://www.google.com/) and leave the operation on set. To send no referrer at all, choose remove instead. Limit the rule to the host that receives the request. The edit changes only what the server receives: document.referrer in the page keeps its real value.

What browsers send by default

The header name really is spelled Referer, a misspelling that made it into the HTTP specification and was never corrected. The policy that controls it, Referrer-Policy, uses the correct spelling.

Chrome, Edge and Firefox all default to the policy strict-origin-when-cross-origin:

A page can tighten or loosen this with a Referrer-Policy response header, a <meta name="referrer"> tag, or rel="noreferrer" and referrerpolicy attributes on links and elements. A HeaderDial rule acts after all of that: set sends your value even where the policy would have trimmed or dropped the referrer, and remove drops it even where the policy would have sent it.

When you need to change it

Steps

  1. Click the HeaderDial icon to open the popup. If the site-access banner appears, choose Allow on all sites or Only <current host>.
  2. Click + Request header and type Referer (it is in the suggestions). Enter the URL you want the server to see, such as https://partner.example/blog/review.
  3. Keep the operation on set, or pick remove to test the no-referrer case. Chrome's declarativeNetRequest API, which HeaderDial uses, allows set and remove on Referer but not append. If you choose append, HeaderDial sets the value instead and shows the message "browsers only allow appending to a few request headers, so it is set instead".
  4. Open Where it applies and click + Only on… with type Domain for the host that receives the request.
  5. Reload and check the result in your server log or an endpoint that echoes request headers back.

Filters match the request, not the page

A filter is compared with the URL being requested, not with the page that made the request. If www.example.com shows images from cdn.example.com and you want to test the CDN's hotlink rule, the filter must be cdn.example.com. To leave page loads and scripts alone, tick only image under the request types; with none ticked, the rule covers every type, including page loads.

For side-by-side comparisons, make one profile per referrer ("From Google", "No referrer", "Foreign site") and switch between them with each profile's Active switch. If two active profiles set Referer, the leftmost chip wins.

What a header rule does not change

We checked this in Chrome 159 and Firefox 158 with HeaderDial 0.1.0: with Referer set to https://www.google.com/, the server received that value on both page loads and fetch() calls, while document.referrer on the next page still showed the real previous page. Keep that in mind when you test:

The curl equivalent

# send a referrer (-e is short for --referer)
curl -e https://www.google.com/ https://www.example.com/landing

# the same with an explicit header
curl -H "Referer: https://partner.example/blog/review" https://cdn.example.com/photo.jpg

# curl sends no Referer unless asked, so the missing case is simply
curl https://cdn.example.com/photo.jpg

Pitfalls

Without a filter, your Referer value goes to every site the browser talks to. That breaks hotlink-protected images elsewhere and pollutes other sites' analytics. Always add an Only on filter.

To drop other headers the same way, see how to remove a request header.

Add to ChromeFirefox: coming soon