Proxy to another domain

What is the name of the domain?

What is the issue you’re encountering

how can I proxy a specific url to another domain

What steps have you taken to resolve the issue?

Hi there,

i have a main website (mysite.co.uk) and a wordpress blog on mysite.com , hosted with different providers.

Now, I want when someone types mysite.co.uk/blog it will point to mysite.com. Pretty common requirement i’m sure.

We don;t want to do a redirect for SEO purposes, so want to proxy the request to keep the original domain.

Unfortunately we have no option to do this at the host of mysite.co.uk and they suggested using cloudflare.

Any ideas?

Thanks!

What feature, service or problem is this related to?

I don’t know

Use a Worker or Snippet like this…

thanks for the info, is this definately a proxy solution not a redirect?
I have read elsewhere on the forum that this is only possible with an enterprise plan.

1 Like

You just need a Pro plan to do it with a Snippet as in that example. Enterprise plans do have other options for this, which is probably what you read about.

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

are you able to help me modify this script for my requirments, as I have no experience with the workers scripting language.
I want to proxy all requests from mysite.co.uk/blog to mysite.com
or at least mysite.com/blog, whichever is easier.
Including any querystrings, form submissions etc.

hi, I already have a pro plan, but its not working.
I used the snippet but I just get a 404 page instead.
here is a screenshot of my snippet

and the snippet rules is
(http.request.uri.path contains “/blog”)

The request is returning a redirect, which fetch doesn’t follow. In your snippet, change the target URL to the final URL, which has the www on the front of it.