Multiple URL Rewrite rules aren't triggering.

I have a site with multiple URL Rewrite Transform rules. One of them rewrite the path. Then a subsequent rule should trigger on that rewritten rule and make a different change. However, when I run a trace, I only see the first rule triggering but not the second. e.g. Rule 1: Rewrite Banana to Mango (http.host eq "example.com" and http.request.uri.path eq "/banana") Path: Rewrite to Static /mango Rule 2: Rewrite Mango to Homepage (http.host eq "example.com" and http.request.uri.path eq "/mango") Path: Rewrite to Static / When I go to example.com/mango in a browser (triggering only rule 2), I do indeed get the home page served. However, when I go to example.com/banana, it gets rewritten to /mango but does NOT subsequently get rewritten to /. Because /mango isn't a real page, I get a 404. From https://developers.cloudflare.com/rules/transform/:
Transform Rules run in order. Rules that appear later in the list of Transform Rules can overwrite changes done by previous rules. You can define the rule order in the dashboard or via API.
Shouldn't the second URL Rewrite rule be able to trigger on a URL that was modified by an earlier rule?
1 Reply
McGuireR
McGuireR3mo ago
Never mind... All I have to do is RTFM.
https://developers.cloudflare.com/ruleset-engine/about/rules/#rule-evaluation:
If a rewrite URL rule #1 updates the URI path or the query string of a request, rewrite URL rule #2 will not take these earlier changes into consideration.
Cloudflare Docs
Rules · Cloudflare Ruleset Engine docs
A rule defines a filter and an action to perform on the incoming requests that match the filter. The rule filter expression defines the scope of the …