How rules match

Every rule has a pattern, optional methods, and an action. A rule matches a request when the pattern matches its full URL and the method is allowed.

Patterns

  • URL contains: the URL includes this text anywhere. /api/users matches https://example.com/api/users/42?x=1.
  • URL matches regex: a JavaScript regular expression tested against the full URL, without the surrounding slashes. For example /api/users/\d+$.
  • Matching ignores case unless you tick Case sensitive.

Paste a URL into Test URL in the editor to check whether the rule matches it before saving.

Block, redirect and header rules run in Chrome’s network stack, which uses the RE2 regex engine: lookarounds and backreferences aren’t supported there. The editor tells you when a regex can’t be used for those actions.

Methods

A rule applies to any method, or only to the methods you pick: GET, POST, PUT, PATCH, DELETE, HEAD and OPTIONS. Use this to fake a failed save (POST returns 422) while reads still go to the server.

Priority: the first match wins

Rules are checked top to bottom as listed, folders included, and the first matching rule decides what happens to the request. Drag rows to reorder them, or use the ↑ and ↓ buttons.

Header rules are the exception: every matching header rule applies, on top of whatever other rule handles the request.

Folders and switches

  • Group rules into folders, nested as deep as you like. Collapsed folders stay collapsed between visits.
  • A folder has its own switch: turning it off disables everything inside, while each rule keeps its own switch.
  • The Enabled switch in the header turns every rule on or off at once.

Plan limits

Each plan allows a number of rules and of active rules. When more rules are switched on than your plan runs, the first ones (top to bottom) run and the rest are marked inactive: plan limit. Nothing is deleted or switched off for you: turn another rule off, or upgrade, and they run again. See Plans, limits and your account.

Something unclear or missing? Tell me, and I'll fix the docs.