Target Selection
Every time someone visits a route, Divertly runs the route’s targeting strategy against the request and picks one target. This page spells out the rules, including what happens when more than one target matches, or none do.
Availability by plan
Weighted and Random are available on every plan. The other strategies are available on paid plans. You can list the strategies your organization can use from the targetStrategies field of the entitlements endpoint.
The resolution rules
- A route with no targets has nowhere to send the visitor, and the request returns an error.
- A route with exactly one target sends every visitor to it, whatever the strategy.
- Otherwise the strategy runs, as described below.
- If the strategy finds no match, the route’s fallback applies.
Weighted and Random
- Random picks any target with equal probability.
- Weighted picks a target in proportion to its weight. A target with weight 90 and one with weight 10 receive roughly 90% and 10% of traffic. A target with a weight of 0 is never chosen while another target has a weight above 0. If every weight is 0, the route picks at random instead.
- Weighted routes can be made sticky, so a returning visitor keeps landing on the same target. Sticky behavior is set with the
stickyfield when you update a route through the API.
Match-based strategies
Country, Language, Device Type, Browser, Operating System, HTTP Header, Query String, and User Agent compare an attribute of the request with each target’s match value:
How matching works:
- A target’s match value is treated as a regular expression, and matches if it appears anywhere in the request’s value. Matching is case-sensitive.
enmatches the language headeren-US,en;q=0.9, andChromematches any user agent containingChrome. To match exactly, anchor the pattern with^and$. - Targets are checked in turn, and the first matching target wins. If your match values can overlap, a request may match several targets, so write them so that they don’t.
- A target whose match value isn’t a valid regular expression is skipped.
- If the request doesn’t carry the attribute at all, such as a missing header, a missing query parameter, or an IP address whose country isn’t known, nothing matches and the fallback applies.
Pick match values from the preset list when the dashboard offers one, for Country, Device Type, Operating System, Language, and Browser. These are already in the form the strategy expects.
Human vs. Bot
Each request is classified as a human visitor or automated traffic. A target’s match value is Humans, Bots, or Any. A human request considers targets set to Humans or Any, and a bot request considers targets set to Bots or Any. If more than one qualifies, one is chosen at random. See Redirect Bot Traffic.
IP CIDR
A target’s match value can be a single IPv4 address (203.0.113.7), a CIDR range (203.0.113.0/24), or several of these separated by commas (203.0.113.0/24, 198.51.100.7). The request matches when the visitor’s IP address falls in any of them. Targets are checked in turn and the first match wins.
When nothing matches
The route’s Targeting Fallback decides what happens:
Changes take effect immediately
Selection runs on every request, so changing a strategy, a match value, a weight, or whether a target is enabled applies to the next visit. There’s nothing to publish.

