I have a SSL certificate for non www URL: https://example.com
I know there are many similar question, but none of them seems to solve my problem. Here is what I am trying to do:
Problem:
1) http://www.example.com -> https://example.com **www to non www DONE**
2) http://example.com -> https://example.com **http to https DONE**
So far, my .htaccess file looks like so:
# www to non www
# http to https
# SSL off
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^http\.(.*)$ [NC]
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
# https://www to https://
Does anyone know the solution? With the current solution, I only get the following error message from the browser:
Corrupted Content Error
The site at http://example.com/ has experienced a network protocol violation that cannot be repaired.
The page you are trying to view cannot be shown because an error in the data transmission was detected.
Please contact the website owners to inform them of this problem.
Here are the solutions that I already tried: