https problems

I’m using the following code in my htaccess file:

# non-www to https://www.
RewriteCond %{HTTP_HOST} !^www.example.com$ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]

#PBC - http: traffic to https: 
RewriteCond %{HTTPS} off
RewriteRule ^ https://www.example.com%{REQUEST_URI} [L,R=301]

to redirect as needed the following URL forms:

http://www.example.com
https://example.com
http://example.com

The goal (proper form) is https://www.example.com, in as few redirects as possible.

All works well in Chrome (windows 10).
Website “301 checkers” state that the redirect directives work fine.

However, I encounter a problem with https://example.com
when I use FireFox or Microsoft Edge (windows 10, desktop) or android mobile browsers Chrome and Dolphin.

With them I get a “non-secure” (broken https) notification.
In the Address Bar of the browser it shows the URL https://example.com (suggesting that no redirection took place).

I’ve tested rewording my htaccess redirection code 4 different ways. With each working fine with desktop Chrome and the website 301 checkers. But in each case get the exact same problems with the other browsers mentioned above. (It seems to be a redirect problem, but somehow not with my htaccess file, I guess).

The SSL certificate is an “Let’s Encrypt” one. I ran it through a website SSL checker and it suggested it was fine. It works fine when the correct URL shows in the browser address bar.

Is there some aspect of Drupal that could somehow negate or reverse my redirection directives for just the URL form: https://example.com

Thanks.

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/22/feed