I created here a simple project based on static pages.
It has just several pages but I’d like to provide a forwarding to “/docs” subfolder.
I also have another documentation project hosted on Vercel.
So, the idea is to forward mycloudflaresite.com/docs/intro
to mydocsite.vercel.com/docs/intro
.
It shouldn’t be redirection because I don’t want the URL in the browser to be changed.
And users should be able to surf inside the documentation that would look like they surf inside my site but actually inside the documentation site.
Is that possible?
Thanks!
As noted in the Pages documentation under redirects → proxying
You cannot proxy external domains.
This applied to anything in the _redirects
file of the deploy.
As far as I know there is no mechanism to facilitate the proxy you desire. You can easily forward /docs/*
with Page Rules, but that’s not what you are wanting.
Thanks. I’m not sure if it’s called proxying.
According to this post, it’s possible. https://community.cloudflare.com/t/can-cloudflare-map-a-subfolder-to-another-website-or-domain/300747
But not sure how the author did it.
Also, found another post about the same but it says it’s only available for Enterprise customers which I’m not. https://community.cloudflare.com/t/forward-subfolder-requests-to-different-server-using-page-rules/18324
You could use Workers, have the worker running on a specific route then using this example as a starting point, have the worker fetch from content from the other site and return it to the user.
Thanks, I will look at the workers.
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.