Rewrite doesn't work ssl error

I got 3 domains: example example-1 example-2 (all dot com)
when I tested everything at the beginning I setup my server for test.example-1dotcom without cloudflare.
now I want all 3 domains to go to httpsexampledotcom
which works perfectly with example and example-2
but for the domain used previously to test I get an certificate expired error.
(I had to replace all .com with dotcom due to new user restriction)

my cloudlfare configuration:
DNS example-1dotcom
||A|example.com|“Server-IP”|Auto|!
||CNAME|www|exampledotcom|Auto|!
Rules exampledotcom:
www.exampledotcom/*
(Statuscode: 301: Permanent, URL: httpsexampledotcom/$1)

DNS example-1dotcom
||A|example-1dotcom|“Server-IP”|Auto|!
||CNAME|www|exampledotcom|Auto|!
||CNAME|test|exampledotcom|Auto|!
Rules example-1dotcom
test.example-1dotcom/*
(Statuscode: 301: Permanent, URL: httpsexampledotcom/$1)
www.example-1dotcom/*
(Statuscode: 301: Permanent, URL: https://exampledotcom/$1)
example-1dotcom/*
(Statuscode: 301: Permanent, URL: https://example.com/$1)

||A|example-2.com|“Server-IP”|Auto|!
||CNAME|www|example.com|Auto|!
Rules example-2dotcom
www.example-2dotcom/*
(Statuscode: 301: Permanent, URL: https://exampledotcom/$1)
example-2dotcom/*
(Statuscode: 301: Permanent, URL: https://exampledotcom/$1)

All domains have complete SSL modus
the SSL/TLS recomender is active

I have no clue why the domain I used for testing doen’t work with the cloudflare ssl certificate.
Thanks for your help

It is difficult to understand what the issue is due to the formatting of your post.

My understanding is that you want all requests to example-1.com, www.example-1.com and test.example-1.com to be redirected to https://www.example.com/$1. Is that correct?

For the page rules to work, the three DNS entries must be :orange:. Do you have any other page rules in place?

As you are redirecting all traffic for these hostnames, the target of the DNS entry, and the SSL Mode does not matter. No requests will be made to the origin for example-1.com.

1 Like

sry for the formatting.
I want all requests be rewritten from all domains and subdomains to example.com/$1
I got the cloud simbol for all A Level records and all cnames.
I got no other page rules. (1 for example.com rewritting the www 2 for the other 2 domains and and an additional 1 rewriting test.example-1.com)

Edit: I just checked again it now seems to work. I don’t know why it took 5 hours for the rewrites of the one domain to take effect when the other two worked immidiatly. thanks for your help.