need help with page rule

hello,
i have main domain
ex, [example.com] (http://example.com/)
and i redirect this domain to [https://a.example.com]
now i want to redirect sub folder to another sub domain without losing the main redirect
for example
a.example.com/folder1
to
b.example.com
but without losing the main redirect from example.com to a.example.com
how can i handle this?

Hi,

You’ll need two rules, with the most specific one placed above the least specific to make sure that only URLs for the subfolder will trigger the first rule.

Rule 1
example.com/subfolder/*
Redirect to: A

Rule 2
example.com/*
Redirect to B

2 Likes

thanks for your reply
but the browser gave me an error (ERR_TOO_MANY_REDIRECTS)
how can i fix this

May I suggest looking into below article:

Furthermore, may I ask what SSL option have you got selected under the SSL/TLS tab on Cloudflare dashboard for your domain (Flexible, Full, Full Strict …)?

May I ask were your naked (main) non-www and www, and also both a and b sub-domains working over HTTPS and have had a valid SSL certificate being properly installed at your origin host / server?

ssl selected is ( full )

non www ( https://a5bar24h.com)
www ( https://www.a5bar24h.com)

i have redirected before https://www.a5bar24h.com to ( https://jarida.a5bar24h.com )

and now i want to redirect a sub folder in the sub domain to the main domain with www
example
i want to redirect رياضة - جريدة أخبار 24 ساعة
to
رياضة - جريدة أخبار 24 ساعة
but without losing the main redirect i explain first
can you help me with that
thanks for your time