Dynamic Transformation Rule help

Suppose i have this. url


I want to rewrite to


How can i create rewrite rule?

I can do the first half where i can write if uri contains but i am nots ure how can i dynamic field to chnage the hostname and complex uri path edit

You can try following the example here:


But note that you want to rewrite the entire URI, not just the path, so you’d want to use http.request.uri and not just http.request.uri.path.

This can be done with Host Header and/or Resolve Override in Page Rules if you have an Enterprise plan. Otherwise you will have to use Cloudflare Workers.

1 Like

Good callout - I should clarify that using a regular expression in Transform Rules is a Business plan (or above) feature:


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.