Detour is a Cloudflare Worker that resolves redirects at the edge — before a request ever reaches your origin — and logs the 404s that slip through. Exact and regex rules, query-string preservation, redirect-chain detection. Built for agencies migrating sites and devs who hate watching 404s pile up.
Rules live in Cloudflare KV and resolve in the Worker before the request ever reaches your origin. A hit is a single edge read — 301 or 302 returned with no round-trip, no plugin boot, no PHP. Faster than anything that runs on your server could ever be.
Exact rules for one-to-one moves (/old → /new) and regex rules with backreferences for whole sections (^/blog/(.+)$ → /articles/$1). Exact always beats regex; regex is first-match-wins in insertion order, so layered migrations stay predictable.
By default the visitor's query string carries through to the destination — /old?ref=email → /new?ref=email — so your UTM tags and tracking params survive the redirect. Need to drop them? Flip keepQuery:false per rule.
Every dead link is logged at the edge with a hit count and first/last-seen timestamps — so you catch the broken URL the day it starts hurting, not weeks later when Google finally reports it. PII-free by design: paths and counts only, never IPs or user agents.
Migrations stack up chains — A→B→C — that burn crawl budget and waste a hop on every visit. The chain linter flags every redirect whose destination is itself a source, shows you the full chain, and tells you the final target to collapse to. It catches loops, too.
A vanilla-JS admin tool at /admin and a clean control-plane API, both gated by a single X-Detour-Admin secret with constant-time comparison. No secret set means the control plane fails closed. CSV bulk import lets you load a whole migration's rules in one paste.
Add your host as a custom domain on the Detour Worker, or attach the Worker to a yoursite.com/* route on your own Cloudflare zone. Set your real origin so unmatched requests proxy straight through.
Use the admin tool at /admin or the API to add exact and regex redirects — or bulk-import a whole migration from a CSV with a single source,destination,type,regex header.
On every request, the Worker checks the exact rule key first, then the regex list. A hit returns 301/302 immediately — before your origin is touched. A miss proxies through to your real site.
The 404 log surfaces dead links the moment they're hit. Run the chain linter to find A→B→C hops and collapse them to the final target. Clean redirects, fewer 404s, happier crawlers.
Free covers exact 301/302 redirects and a recent 404 log. A license adds regex rules, the unlimited log, CSV import, and the chain detector.
It runs at the edge — in a Cloudflare Worker, before the request ever reaches your origin server. A WordPress redirect plugin only fires after PHP boots; an .htaccess rule only fires once Apache has the request. Detour resolves the redirect on Cloudflare's network, which means it's CDN-cache-aware, instant, and works even if your origin is slow or down. It also means zero load on your server for redirects.
Regex rules let you redirect whole sections in one line. A source pattern like ^/blog/(\d{4})/(.+)$ with destination /articles/$2 uses $1, $2 backreferences to the captured groups. Exact rules always take precedence over regex, and regex rules are evaluated in insertion order — first match wins — so a big migration stays predictable. Regex is a paid-tier feature.
For each dead path: the path itself, a hit count, and first-seen / last-seen timestamps — that's it. It's PII-free by design, with no IPs and no user agents. The free tier keeps the last 50; a license unlocks the full log with filtering and export so you can hunt down broken links the day they start hurting instead of waiting weeks for Search Console.
A chain is A→B→C: an old URL redirects to another URL that itself redirects again. Each hop costs a round-trip and burns crawl budget, and chains tend to pile up across multiple migrations. The chain detector (paid) flags every rule whose destination is itself a source, shows you the full chain and its final target, and catches loops — so you can rewrite A→C directly.
Yes, by default. /old?ref=email → /new?ref=email — the visitor's query string is carried to the destination, and if the destination already has its own query, the two are merged. If you'd rather strip the query on a given rule, set keepQuery:false when you create it.
Two ways: add your hostname as a custom domain on the Detour Worker, or attach the Worker to a yoursite.com/* route on your own Cloudflare zone. Then set your real origin so any unmatched request proxies straight through to your live site — only the paths you've added rules for get redirected. Manage everything from the token-protected admin tool at /admin.