In order to get Cloudflare CDN working on my site, I had to change my domain to a www. My hosting provider told me to update my .htaccess to accomplish this. The Cloudflare began working with the update. A few weeks later, I now note that the 301 redirects are no longer working. If I change back to my older code, it works. I am hoping that someone can see the error in the code that is preventing the redirects. Thank you.
Okay, got it working with help from my provider A2 Hosting. Made a small adjustment in the www. redirect and then simplified my code for each redirect.
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTPS_HOST}/$1 [R=301,L]
I would try and disable The Cloudfare cachee and if that does not resolve the problem then disable Cloudfare and check every link to ensure redirection is correct.