URL rewriting to another domain

Hello,

I am trying to configure URL rewrites on my Cloudflare distribution. I am looking to implement the following changes:

  • Rewrite website1[.]tld/2 to website2[.]tld
  • Rewrite website1[.]tld/3 to website3[.]tld

I tried to use the URL rewrite feature in the transform rules, but it appears I’m only able to rewrite URLs within the scope of the current host, i.e., website1[.]tld.

From what I gather from the documentation, it might be feasible to achieve this using origin rules, but I am unable to figure out the specifics on how to set this up.

Would anyone be able to provide some guidance through this process, or perhaps suggest another method for accomplishing these URL rewrites?

Thank you in advance!

Use bulk redirects https://developers.cloudflare.com/rules/url-forwarding/bulk-redirects/

1 Like

Thank you for your answer!
However I am not looking to do a redirection, I want to do url rewriting (meaning the url won’t change for the viewer).

The perhaps look at the bulk origins override worker example then https://developers.cloudflare.com/workers/examples/bulk-origin-proxy/

2 Likes

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