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:
- Same-origin requests carry the full URL, without the
#fragment. - Cross-origin requests carry only the origin, such as
https://shop.example/, not the path or query string. - Requests from an HTTPS page to an HTTP URL carry no referrer.
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
- Hotlink protection. Check that images or downloads load when the referrer is your own site and are refused when it is another site or missing.
- Referral tracking. Test how analytics or landing pages classify a visit "from Google" or from a partner site, without clicking through from that site.
- CSRF defences. Some frameworks compare the referrer with the site's own origin on HTTPS form posts, especially when no
Originheader is present. Sending a foreign or missing referrer shows whether the check rejects the request. - Bug reports. Reproduce a request exactly as it arrived from a referring page listed in your logs.
Steps
- Click the HeaderDial icon to open the popup. If the site-access banner appears, choose Allow on all sites or Only <current host>.
- Click + Request header and type
Referer(it is in the suggestions). Enter the URL you want the server to see, such ashttps://partner.example/blog/review. - 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".
- Open Where it applies and click + Only on… with type Domain for the host that receives the request.
- 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:
- Client-side code is unaffected. Analytics scripts that read
document.referrerin the browser report the real referrer. Only server-side logic sees your value. Originis a separate header. CSRF checks and CORS useOriginfirst. To test them you may need to set or removeOriginas well.Sec-Fetch-Sitestill tells the truth. Browsers sendSec-Fetch-Site: same-origin,same-siteorcross-site, and a server that checks it is not fooled by a different referrer. An extension can changeSec-Fetch-Siteas well, in Chrome and Firefox alike; see which headers browsers won't let you change.
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
- Cached responses. An image already in the browser cache is not requested again, so the server never sees the new referrer. Tick "Disable cache" in the DevTools Network panel while testing, or see testing with Cache-Control.
- Removing is not the same as an empty value. Servers can treat a missing referrer differently from an empty or foreign one. nginx's
valid_referers, for example, has a separatenonekeyword for requests without the header. Use remove to test the missing case. - Switch it off afterwards. Give the row an expiry such as 1 hour, or use the global On/Paused switch.
To drop other headers the same way, see how to remove a request header.
Add to ChromeFirefox: coming soon