Privacy HeaderPrivacy Header

Regex Targeting

Apply headers to specific URLs using Regex

Regex Targeting

One of the most powerful features of Privacy Header is the ability to apply headers only when the URL matches a specific pattern.

How it Works

When adding a header, you can specify a Regex pattern. The extension checks the URL of every outgoing request against this pattern.

  • If the URL matches, the header is modified.
  • If the URL does not match, the header is left unchanged.

Examples

Match a specific domain

To apply headers only to example.com:

^https?:\/\/(www\.)?example\.com\/.*

Match all subdomains

To apply headers to api.test.com, app.test.com, etc.:

^https?:\/\/.*\.test\.com\/.*

Match a specific path

To apply headers only to API requests:

.*\/api\/v1\/.*

Match Everything (Default)

If you leave the regex field empty or use .*, the header will be applied to all requests.

On this page