Skip to main content

Route Every Visitor to the Right Destination

Condition nodes are the building blocks of Middlewr’s rule engine. Each condition evaluates a single visitor attribute and branches to true or false, letting you build precise targeting logic by chaining multiple conditions together.

20+ Condition Fields

Route by geo (country, continent, city), device (type, OS, browser), request (referrer, language, bot detection), and time (hour, day of week).

Chain Conditions

Wire the false branch of one condition into another to build multi-level targeting. Country → Device → Language, all in one rule graph.

10 Operators

Equals, not equals, in, not in, contains, not contains, greater than, less than, and regex matching — with safety checks.

Zero-Latency Evaluation

Conditions evaluate against data already present in the Cloudflare request context. No external lookups, no added latency.

Supported Condition Fields

Geography (from Cloudflare request.cf)

Request (parsed from headers and User-Agent)

Time (computed at evaluation time, UTC)

Operators

Regex patterns are limited to 200 characters and checked for nested quantifiers, backreferences, and lookarounds to prevent catastrophic backtracking at the edge.

Examples

Geo-routing to localized pages

Device-based deep linking

Time-based routing

Next Steps

A/B Testing

Combine conditions with traffic splits to run experiments on specific audience segments.

Edge Transforms

Add query parameters or override headers based on which condition branch matched.