Forward Apex and all other Subdomains to single Subdomain

I have a domain xyz.com and want to host it as a static site on GitHub Pages.
However, abc.xyz.com should be the only URL that is displayed in the browser, as it is similar to lem.ona.de, it makes only sense with a specific subdomain.
Therefore I want to redirect the root domain xyz.com to abc.xyz.com as well as all other possible subdomains ab34.xyz.com (or typos) to abc.xyz.com.

What I have done (so far):

  • DNS: CNAME * wildcard to match all subdomains to abc.xyz.com
  • DNS: CNAME @ apex to abc.xyz.com
  • DNS: CNAME abc.xyz.com to myusername.github.io
  • Forwarding Rule 1: xyz.com to abc.xyz.com
  • Forwarding Rule 2: *xyz.com to abc.xyz.com

However redirecting any subdomain to the abc subdomain doesnt work, I get an GitHub 404 and the url stays the same (ab34.xyz.com)

Hi @user16034,

Do you have an Enterprise plan? If not, you won’t be able to proxy the wildcard record so the page rule will only redirect subdomains with an explicit DNS record.

https://support.cloudflare.com/hc/en-us/articles/360017421192-Cloudflare-DNS-FAQ#h_2C7rPZioPs5FIMJgvWiPST

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