I solved it. I contacted the hosting company and it appears I needed different https headers. The host returns HTTPS:https instead of HTTPS:On
The following rules in htaccess solved it.
RewriteEngine On
RewriteRule .* – [e=HTTPS:On]
RewriteCond %{SERVER_PORT} 80
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]