Route a path to a seperate origin

The main website is www.example.com and wordpress is running on the same server at www.example.com/blog.
I want to move the wordpress site to it’s own hosting but want it to still seem like it is in the same location to the end user.
Is there anyway I could use Cloudflare to route the traffic from /blog/* path to a different origin?

Would this be possible with page rules, rewrite rules or would it need a worker script?

I do not want it to be a redirect to another domain but rather Cloudflare routing to a separate origin and appearing like one site to the end user.

The only way I can see you doing it is with a Worker, using the resolveOverride property - so you’d put a worker on www.example.com/blog/* and then make use of that property in the fetch call. https://developers.cloudflare.com/workers/runtime-apis/request/#requestinitcfproperties

You can do it with Page Rules, but only on Enterprise.

1 Like

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