Wildcard Subdomain 301 Redirect to Root Domain

Hello,

I would like to know how I can do on my CloudFlare account a Wildcard Subdomain 301 Redirect to Root Domain.

So, for example:

123.mydomain.com/* >> Redirect 301 >> mydomain.com

So all URLS from that subdomain redirect too to root domain.

Thanks!

A page rule that matches *.example.com/*(with the period before the domain) would match only every subdomain, and not the root domain. This would also match www though, so make sure it’s the Apex/root domain. Then the page rule can be set to forwarding URL.

But this would only work for an enterprise customer as a wildcard :orange: record, or by manually adding subdomain records to DNS as needed. Lower tier plans can only create a :grey: wildcard DNS records which means Cloudflare won’t do the redirect across the board.

1 Like

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