How can I make my main site show the content of a sub-domain?

I’m struggling to achieve something I think should be quite simple and I am hoping someone can help.

  1. Let’s say I own the domain MyWebsite(dot)com
  2. On my host I have set up two sub-domain sites: slot1(dot)MyWebsite(dot)com and slot2(dot)MyWebsite(dot)com
    3: I want to configure Cloudflare DNS so that when someone goes to MyWebsite(dot)com they actually see the content of the subdomain slot1(dot)MyWebsite(dot)com from my host, without redirecting.

I’d like to be able to easily swap between slot1 and slot2 on Cloudflare.


Without redirections you either have to implement this via workers - if you insist to have it done on Cloudflare - or simply set your server configuration to serve the right content for each hostname.

Really? Cloudflare cannot ghost another site?

I dont know what you mean by “ghost”, but Cloudflare forwards the request and it is up to your server to serve whatever it is supposed to serve. That is an easy configuration change on your side, but if you cant do that, or dont want to, you can always implement it via workers.

The server is set up to serve on sub domains slot1… and slot2… - I need to know how to configure Cloudflare so that when I visit Cloudflare will request the same URL path but from one of the subdomains.

As I already mentioned you dont need to configure anything on Cloudflare, Cloudflare will simply pass on the request to your server. If your server is properly configured you should receive the right content.

I can’t change my host to serve slot1 sub-domain for the main domain and then switch to slot2 sub-domain, it’s not a feature available on the shared-hosting control panel.

I have slot1 and slot2 sub-domains and they can only be served from those subdomains. I want Cloudflare to serve on the main domain but request from a specified subdomain.

Which brings us back to the first response from 15 hours ago, you’d have to use workers for that if you cant do it on your side.

This topic was automatically closed after 31 days. New replies are no longer allowed.