May I ask why would you redirect non-existing to an existing, rather than per default show the error “as-is”?
For eaxmple if somone want’s to attack your website, would use all A-Z sub-domains tries over the non-existing ones and all of the requests would be redirected to your domain/website which is resolving correctly and would result in overloading your own server? Why sacrificing all that?
Maybe you could achieve this by trying to add a wildcard * (apex) sign into the DNS tab of Cloudflare dashboard, but remember it affects even the sub-domains which you could already use.
Therefore, proxy this hostname by setting it to and then create a Page Rule with 301 Forwarding rule to match the needed *.domain.com/*.
I am really not advising you doing that and cannot confirm if it would work like stated. Again, I am against doing this so far. I am not aware if this is against some ToS and if this would result in violating some.
NOTE: After checking, this can work, but it requires an Enterprise plan due to the usage of wildcard * (apex).
So, I am afraid this so far unfortunately is not possible in your case.
Regarding the 2nd or 3rd or other level sub-domain, you would have to use a Dedicated SSL (provided by the Advanced Certificate Manager), otherwise you would end-up having an issue as described at the article from below:
Hi @fritex, thanks a lot for your answer. Thinking better about it you are totally right about the redirect in case of attacks. Mine was more of a heartiness but given the motivations I don’t think it’s worth it.