McGuireR
McGuireR
CDCloudflare Developers
Created by McGuireR on 3/7/2024 in #general-help
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?
2 replies