I have searched S.O. over and found quite a few answers but none that address this single problem!
I am using:
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Both <VirtualHost *:80>
and <VirtualHost *:443>
are pointing to the same
DocumentRoot /var/www/public_html
WHAT WORKS
http://example.com -> https://example.com
http://www.example.com -> https://example.com
WHAT DOESN'T WORK
https://www.example.com -> https://example.com
Why if both conditions are set, this fails? This comes directly from THIS PROTECTED S.O. QUESTION
What am I getting wrong here?