there’s a workaround using concat
and substring
but it’s pretty ugly and it doesn’t work as well in my tests, a CF employee mentions it on their forum.
Filter expression:
(starts_with(http.request.uri.path, "/old-path/"))
Dynamic URL redirect expression:
concat("/new-path/", substring(http.request.uri.path, 10))
where start byte value (10 in my example) is the length of the old path.
source
https://community.cloudflare.com/t/dynamic-wildcard-redirect-rule/657658/2