Personalize your static site using the HTTP referer header

This is a static page served from Netlify's CDN.

Using Netlify Edge Functions, we can intercept a request to this page, check the value of the HTTP referer header, and modify the response of the HTML before it's returned to the browser. No client-side JavaScript required.

Click here to see the referer message.

Testing in development

  1. Use the Netlify CLI to run this site locally
  2. Make sure the referer detection is set to http://localhost:8888/ and click here.
  3. To remove the HTTP referer header and banner in development, navigate to http://localhost:8888/ without clicking on the link above.