Bulk Redirects: Redirect all subdomains to target URL not working?

Disclaimer: I’ve scoured multiple docs and haven’t been able to find a working solution. I’d link what docs and other posts I’ve read through, but this Discourse instance won’t let me post links: “Sorry, you can’t include links in your posts.”, so I’ve had to replace a ton of URLs with “sanitized” versions (using stuff like (.) and (https://), which might be hard for folks to read)

I have a series of vanity domains set up in Cloudflare that map to my “main” domain, for now we’ll focus on just one of the vanity domains and the main domain:

  • Main domain: domain(.)com
    • blog(.)domain(.)com
    • auth(.)domain(.)com
    • support(.)domain(.)com
  • Vanity domain: domain(.)io
    • No served subdomains

I want the .io to redirect to the .com (including subdomains), so I set up domain(.)io’s DNS like so: (note the wildcards *)

Type Name Content Proxy status
A * 192.0.2.1 Proxied
A @ 192.0.2.1 Proxied
AAAA * 192.0.2.1 Proxied
AAAA @ 192.0.2.1 Proxied

Then I created a bulk redirect like so:

Source URL Target URL Status Parameters
domain(.)io (https://)domain(.)com 301 Preserve query string
Include subdomains
Subpath matching
Preserve path suffix

What I’d like is for the following redirects to happen:

  • blog(.)domain(.)io/some_path?hello=worldblog(.)domain(.)com/some_path?hello=world
  • auth(.)domain(.)com/some_path?hello=worldauth(.)domain(.)com/some_path?hello=world
  • support(.)domain(.)com/some_path?hello=worldsupport(.)domain(.)com/some_path?hello=world
  • asdf(.)domain(.)io/some_path?hello=worldasdf(.)domain(.)com/some_path?hello=world
    • Since this subdomain doesn’t exist on domain(.)com, I’d want it to error as normal.

Instead what happens is:

  • blog(.)domain.io/some_path?hello=worlddomain(.)com/?hello=world
  • auth(.)domain.com/some_path?hello=worlddomain(.)com/?hello=world
  • support(.)domain.com/some_path?hello=worlddomain(.)com/?hello=world
  • asdf(.)domain.io/some_path?hello=worlddomain(.)com/?hello=world

To summarize the issues:

  • Subdomains are not being redirected, despite having “Include subdomains” checked.
  • Paths are not being redirected, despite having “Subpath matching” and “Preserve path suffix” checked.

The closest other community topic I found was one with this path: /t/bulk-redirects-with-wildcards/369709, in which a member of the Cloudflare team summarized:

  • Asterisks as wildcards are ugly from a semantics perspective, and we didnt want to carry that forward into the new product.

Will bulk redirects just not work for me here? Do I need to use page rules for every vanity domain? If this is the case, will my page rules look like the following?

  • *(.)domain(.)io/*$1(.)domain(.)com/$2
    • I had tried this earlier before even attempting bulk redirects, but the subdomain matching wasn’t working for me, though this was before I had set up the DNS wildcards.

Thank you for any and all help/information!