Advanced URL patterns — the matches you did not know
The URL pattern decides where a rule runs. Most users know only example.com/* — but precise matching is the difference between a rule that works "more or less" and one that works exactly where it should.
Five patterns worth knowing
| Pattern | Matches |
|---|---|
https://example.com/admin | only that exact address |
https://example.com/* | every page on that site |
https://*.example.com/* | every subdomain (app., blog., ...) |
*://localhost:*/* | localhost on any port and protocol |
*staging* | any URL containing "staging" |
The substring pattern — the most underrated
The last row of the table is the key one: *staging* is not a "domain" — it is any URL where the word "staging" appears anywhere. One rule with a red "DEV" banner, pattern *staging* — and it marks every staging environment for you, regardless of domain or client.
Patterns stack in the hierarchy
A pattern can be set at three levels: folder, group, rule. They work together — a logical and. A folder of *.example.com/* plus a rule of */checkout* means: "only the checkout page, only on example.com subdomains". Broad at the top, narrow at the bottom.
Common mistakes
- No trailing star.
example.commatches only the home page. Want the whole site —example.com/*. - Too broad a substring.
*app*hitsexample.com... andapple.com, and/happy-path. Make substrings specific. - Protocol matters.
https://...will not catchhttp://localhost. For local work use*://. - A rule that works "almost nowhere". The most common cause — too narrow a pattern. Check whether a
*is missing.
See also
- The folder hierarchy — where patterns stack
- Environment markers — the substring pattern in action
- Rules resilient to change — resilience starts with the match
Install JustZix — and aim a rule exactly where you want it.
Rate this post
No ratings yet — be the first.