Skip to content

Cloudflare Redirect Rules not firing: order, proxy status, and Page Rule leftovers

A Redirect Rule looks correct but requests sail straight past it. The usual causes: a grey-cloud DNS record, an earlier rule matching first, Always Use HTTPS shadowing a scheme filter, or a legacy Page Rule confusing the test. Here is the diagnostic order.

When a Cloudflare Redirect Rule does not fire, the rule expression is usually the last thing wrong. Check, in order: is the hostname’s DNS record proxied (rules only run on orange-cloud traffic); does an earlier rule match first (only the first matching Single Redirect executes); is Always Use HTTPS consuming the request before your rule sees it; and is your browser replaying a cached redirect that misrepresents the test. Only then re-read the expression.

What’s happening

A redirect can be issued by four parties, evaluated in this order: the browser cache (a stored 301 replays without any network request), the Cloudflare edge, the origin, and the CMS. Inside the edge, the sequence is fixed: Always Use HTTPS first, then Bulk Redirects, then Single Redirects top-down — and the first match in the phase wins; later rules are not evaluated for that request. Legacy Forwarding URL Page Rules run after Redirect Rules, so a matching Redirect Rule suppresses the Page Rule — but where your new rule does not match, the old Page Rule still fires, which makes half-migrated zones behave inconsistently.

All of this presupposes step zero: the request must reach the edge. A grey-cloud (DNS only) record hands out the origin IP and Cloudflare never sees the request, so no rule of any kind runs. That single fact explains the majority of “rules are broken” tickets.

What to check first

  • Proxy status of the exact hostname you are testing — orange cloud or grey. The distinction is explained in DNS only vs proxied.
  • Rule position. List the Single Redirects and find the first rule that matches your test URL — it may not be the one you just wrote.
  • Always Use HTTPS, if your rule filters on http.request.scheme eq "http" — the toggle redirects HTTP before rules run, so the filter can never match.
  • Leftover Page Rules with Forwarding URL actions.
  • Plan quota. Free zones hold 10 Single Redirects (25 Pro, 50 Business, 125 Enterprise); the dashboard blocks overage, but imports and API pushes can fail half-way and leave you testing a rule that never saved.

How to verify

Confirm the request even reaches Cloudflare — a redirect from the edge carries server: cloudflare and a cf-ray:

curl -sI 'https://example.com/old-path' | grep -iE 'HTTP/|location|server|cf-ray|cf-cache-status'

No cf-ray at all means grey cloud or wrong DNS — stop and fix that first. An edge-generated redirect has no cf-cache-status; a redirect with cf-cache-status: DYNAMIC or HIT came from (or was cached from) the origin, meaning your edge rule did not match and something downstream answered. Walk the full chain to see what actually happens end to end:

curl -sIL 'https://example.com/old-path' | grep -iE 'HTTP/|location'

Bypass the edge to see the origin’s own behaviour for the same URL (-k for an Origin CA certificate):

curl -skI --resolve example.com:443:203.0.113.10 'https://example.com/old-path' | grep -iE 'HTTP/|location'

Curl never uses a browser cache, so if curl shows the rule working while the browser does not, the browser is replaying a stale 301 — clear it and move on.

The fix

  1. Proxy the record. Set the hostname’s DNS record to orange cloud. If it must stay DNS only, edge rules cannot apply to it — implement the redirect at the origin instead.
  2. Fix rule order. Single Redirects evaluate top-down and only the first match executes. Move the specific rule above the broad one, or tighten the broad rule’s filter so both can coexist. Audit Bulk Redirect lists too — they run before Single Redirects and can consume the URL first.
  3. Resolve the Always Use HTTPS shadow. If the rule should handle HTTP requests itself, turn Always Use HTTPS off and let the rule own the upgrade; otherwise drop the scheme condition and let the toggle do its job. Two owners for the scheme hop is how loops start.
  4. Finish the Page Rule migration. Convert remaining Forwarding URL Page Rules to Redirect Rules and delete the originals, so one engine owns redirects — the process is in migrating Page Rules to modern rules.
  5. Then, and only then, debug the expression. Classic errors: http.host compared against a value with a scheme in it ("https://example.com" never matches a hostname), eq where the path has a trailing slash variant, case-sensitive comparisons against mixed-case URLs, and wildcard patterns missing the ${1} reference in the target. The field and function reference lives in the Rules documentation.

When this fix is wrong

  • The redirect happens but not the one you expect. That is a competing redirect (origin or CMS), not a rule that failed to fire — attribute the hop with the headers above before touching rule order.
  • The rule fires intermittently by geography or device. Suspect a cached redirect at the edge or an A/B of old and new rules, not the rule engine.
  • You are editing the wrong zone. Multi-account setups with staging and production zones for the same domain make this depressingly common; check the zone name in the breadcrumb before concluding anything.

Common mistakes

  • Testing in a browser with history. Cached 301s and HSTS pins fake both failures and successes. Curl first, browser last.
  • Writing the rule for www and testing the apex (or the reverse). Each hostname needs to match the filter — http.host comparisons are exact.
  • Assuming Page Rules win. Redirect Rules run first; a leftover Page Rule only fires where the new rules do not match, which looks like randomness until you know the order.
  • Stacking a Bulk Redirect entry and a Single Redirect for the same URL and editing the one that is not answering.
  • Forgetting that Workers on the route can also redirect — a Worker response is yet another issuer that no rule dashboard will show you.

Prevention

Keep one redirect engine per zone: modern Redirect Rules, with Page Rules fully migrated and deleted. Name rules descriptively, keep specific rules above broad ones, and re-run a short curl suite (the four scheme and host variants plus two known redirected paths) after every rule change. The ten seconds of curl beats an afternoon of dashboard archaeology.

If redirects keep fighting each other across Cloudflare, the origin, and the CMS, Stack Harbor untangles that chain as part of Managed Cloud Ops — book an infrastructure review.