Sitewalk / Guides / Security headers / Referrer-Policy header

Referrer-Policy header: strict-origin-when-cross-origin explained

For most sites the right value is strict-origin-when-cross-origin. Your own pages get the full address of the previous page, other sites get only your domain, and nothing is sent from a secure page to an insecure one.

Here is the header as your server should send it:

Referrer-Policy: strict-origin-when-cross-origin

Below you will find what every value does, how to check your site, how to set the header and what can go wrong.

What the Referrer-Policy header controls

When someone clicks a link, or your page loads a file from another server, the browser can send a request header called Referer. It tells the receiving server which page the request came from. The Referrer-Policy response header sets how much of that address the browser shares.

The spelling differs on purpose. Referer is a historic misspelling that stayed in the web standard. Referrer-Policy is spelled correctly. If you type Referer-Policy in a server file, you have created a header that browsers do not read as a policy.

An address can carry more than a page name. Think of a search box that puts the search words in the address, a reset link with a token, or an order page with a customer number. A loose policy can hand those details to every outside server your page talks to.

Three words help with the table below:

What strict-origin-when-cross-origin means

The name reads as two rules joined together. When the request is cross origin, send only the origin. The word strict adds that nothing is sent when you move from HTTPS down to HTTP.

Say a visitor is on https://example.com/orders?id=42:

Where the request goesWhat the other side receives
https://example.com/helphttps://example.com/orders?id=42
https://shop.example.com/https://example.com/
https://another-site.example/https://example.com/
http://another-site.example/Nothing

MDN lists this value as the default when a page sets no policy, or sets one the browser does not understand. The older default was no-referrer-when-downgrade, which shared the full address with other HTTPS sites.

It is also not a CORS setting. You may see the text next to a failed request in developer tools. The referrer policy only decides what goes into the referrer. If a script is blocked from reading another server's reply, look at that server's Access-Control-Allow-Origin header.

All eight values compared

ValueOwn origin getsOther HTTPS sites getHTTPS to HTTP gets
no-referrerNothingNothingNothing
same-originFull addressNothingNothing
strict-originOrigin onlyOrigin onlyNothing
strict-origin-when-cross-originFull addressOrigin onlyNothing
originOrigin onlyOrigin onlyOrigin only
origin-when-cross-originFull addressOrigin onlyOrigin only
no-referrer-when-downgradeFull addressFull addressNothing
unsafe-urlFull addressFull addressFull address

The table assumes your page is on HTTPS. Pick with these questions:

  1. Do your own reports need to know the previous page on your site? Keep a value that shares the full address with your own origin.
  2. Should partners know that a visit came from your site? Keep at least the origin for other sites.
  3. Are your addresses private, such as an internal tool? Use no-referrer or same-origin.
  4. Not sure? Use strict-origin-when-cross-origin.

MDN warns that unsafe-url can leak private information from secure pages to insecure ones. We would not use it for a whole site.

Why set it when browsers already have a default

A missing header is not a hole in a current browser that follows the default. Setting it still helps for three reasons.

Treat this as a small tidy-up. It will not repair a slow or broken page, and we make no claim that it changes rankings.

How to check your header

For one page, run this in a terminal:

curl -s -o /dev/null -D - https://example.com/ | grep -i referrer-policy

No output means the reply had no such header. On our own home page on 30 Nov 2026 it printed referrer-policy: strict-origin-when-cross-origin.

To check several pages and grade the value, save this as refcheck.py:

import sys, urllib.request

VALID = {"no-referrer", "no-referrer-when-downgrade", "origin", "origin-when-cross-origin",
         "same-origin", "strict-origin", "strict-origin-when-cross-origin", "unsafe-url"}

def verdict(value):
    if value is None:
        return "no header"
    known = [t.strip().lower() for t in value.split(",") if t.strip().lower() in VALID]
    if not known:
        return "no value a browser knows"
    if known[-1] == "unsafe-url":
        return "unsafe-url sends the full address to other sites"
    return "ok: " + known[-1]

for url in sys.argv[1:]:
    req = urllib.request.Request(url, headers={"User-Agent": "referrer-check"})
    with urllib.request.urlopen(req, timeout=15) as res:
        found = res.headers.get_all("Referrer-Policy")
    value = ", ".join(found) if found else None
    print(url, "|", value, "|", verdict(value))

Run it with pages from each part of your site:

python3 refcheck.py https://example.com/ https://example.com/contact/

We ran it against our home page and six local test replies. It read a normal value and a comma separated list, flagged unsafe-url, flagged a misspelled value, and reported a reply with no header. It follows redirects and grades the final reply. It stops with an error when a page returns an error status.

The script reads headers only. A page can also set a policy in its HTML, covered below, so look at the source too if behaviour surprises you.

How to add the header

On Apache with the headers module enabled, add this to the site configuration or .htaccess:

<IfModule mod_headers.c>
  Header always set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

We tested these lines in a local Apache 2.4 server configuration. The header appeared on a normal page and on a 404 page. We did not test them inside .htaccess, so check your pages after saving.

On nginx, the line goes in the server block:

add_header Referrer-Policy "strict-origin-when-cross-origin" always;

We have not run this nginx line ourselves. The nginx documentation says always adds the header on every response code. It also says headers from the outer level are inherited only if the current level has no add_header of its own. So a location block with any add_header line needs this one repeated, unless you use the newer add_header_inherit setting.

If you cannot edit the server, your host, CDN or security plugin may offer a response header setting. Set it in one place only. Two layers adding the header can produce two values that you did not plan.

You can set a policy in HTML as well:

<meta name="referrer" content="strict-origin-when-cross-origin">

You can also change one link or image with the referrerpolicy attribute. A link with rel="noreferrer" sends no referrer for that click. Note the spelling: the rel word has no dash, while the policy value no-referrer does.

Common mistakes

Check it worked

  1. Clear your page cache and CDN cache.
  2. Run the script again. Each page should print ok: followed by your value.
  3. Check a redirect, a 404 page and a file such as an image.
  4. Open developer tools, select the Network tab, click a link to another site and read the Referer request header.
  5. Test sign in, payment and embedded tools. Some outside services expect to see your domain.
  6. Run your audit again and confirm the finding is gone.

Other headers are checked the same way. See our guides on the HSTS header, Content-Security-Policy, X-Content-Type-Options and clickjacking protection.

What Sitewalk found on real sites

Counted on 30 Nov 2026: 76 of 120 eligible audited sites (63.3%) sent no Referrer-Policy header on the home page. None of the 120 sent a value that Sitewalk grades as unsafe or unknown. Eligible means the site's latest audit ran after this check was added on 4 Nov 2026. It is a small early user group, a first look and not a survey.

The check reads the home page reply only. Your other pages can differ.

Questions people ask

What is strict-origin-when-cross-origin?

It is a referrer policy value. Your own origin receives the full address, other secure sites receive only your origin, and insecure destinations receive nothing from a secure page.

Is strict-origin-when-cross-origin a CORS error?

No. It describes what goes into the referrer. A CORS failure is about whether the other server allows your script to read its reply.

Which Referrer-Policy value should I use?

Start with strict-origin-when-cross-origin. Choose same-origin or no-referrer when outside sites should learn nothing about your pages.

Is a missing Referrer-Policy header a problem?

It is a minor finding. Current browsers fall back to a safe default, and setting the header makes your choice explicit.

Does this header affect my analytics?

It can. A stricter value on a site that links to you means your reports see less about where visits began. Your policy controls what you pass on to others.

Check your whole site in one sentence

Audit example.com for technical SEO problems

Get started

Checked on 30 Nov 2026. Sources: MDN Referrer-Policy reference, W3C Referrer Policy and nginx headers module, read on 30 Nov 2026. Sitewalk counts are from audits counted on 30 Nov 2026.

More guides

All guides