INTERMEDIATE
DocsRouting rules
One link doesn’t have to lead one place. Routing rules let a single Kilo link send visitors to different destinations based on who and where they are - and every decision happens at the edge, inside the redirect, so the visitor never feels it.
Where rules run
The most important thing about Kilo’s routing isn’t any single rule - it’s where they run. When someone hits your link, the rules are evaluated at the edge, inside the same redirect that sends them onward, resolving in roughly 50 milliseconds. There’s no round trip to a database and no script on your destination page. The visitor experiences a plain, fast redirect; the branching happens invisibly on the way through.
Everything below is configured per link in the dashboard and takes effect on the next scan. You can layer several rules on one link.
Geo: country, region, city
A geo rule sends visitors to different destinations based on where they are. You can match on country, on region (a state or province - for example California, or Tel Aviv District), or on city. Send European scans to a localized page and everyone else to the default; route three cities to three storefronts; keep one destination for a single country and a fallback for the rest of the world. Region and city come from Cloudflare’s network-level geolocation, which is approximate - accurate enough to route a campaign, not a substitute for asking someone their address.
Device and OS
A device rule branches on how the visitor is browsing: mobile versus desktop, and the operating system - iOS, Android, and the rest. The classic use is an app link: send iPhone scans to the App Store, Android scans to Google Play, and desktop visitors to a web page, all from one QR code on one poster. The device and OS are read from the request as it passes through, using a lightweight parser on the hot path.
Weighted A/B splits
An A/B rule splits traffic across two or more destinations by weight - say 50/50, or 80/20 - so you can test which page performs better. Assignment is deterministic: a given visitor is hashed to a bucket and sticks to the same variant on repeat visits, rather than being reshuffled each time, so your test stays coherent. Which variant fired is recorded in analytics, so you can compare outcomes side by side. You can also gate an A/B test behind a geo or device audience, so the split only applies to the visitors you’re testing on.
Scheduling and group overrides
Two more controls operate at the campaign level rather than on a single rule. A campaign group can carry a time window - a start, an end, or both - that applies to every link in it. Outside the window the links stop forwarding to their normal destination and instead either fall back to a URL you choose or show a branded “not available” page, your choice. It’s how you make a whole set of codes go live and wind down on a schedule without babysitting them.
A group can also carry a default destination that overrides every link inside it, so you can re-point an entire campaign by editing one URL. That’s covered in more detail in the link lifecycle guide; here it’s worth knowing it sits alongside the per-link rules as a way to steer many links at once.
Order and priority
When a link has more than one rule, Kilo evaluates them in a fixed priority order and the first match wins. A group or admin destination override comes first, then geo rules, then device rules, then A/B splits, and finally - if nothing matched - the link’s default destination. The default is the safety net: every visitor who doesn’t fit a rule still lands somewhere sensible.
A practical way to think about it
Put your most specific intent in the higher-priority rules and let the default catch everyone else. A US-only launch page as a geo rule, an app-store split as a device rule, and a plain marketing page as the default is a complete, sane setup - and it all resolves in one edge hop.
Rules decide where a click goes. The next guide is about judging the clicks themselves - telling the real traffic from the machines.
Set up a rule