Cannot edit orders after change to https - OpenCart 2X

After changing into https and adding the following code to the .htaccess file:

 RewriteCond %{HTTP_HOST} domainname\.com [NC]
 RewriteCond %{SERVER_PORT} 80
 RewriteRule ^(.*)$$1 [R,L]

I get a 'SytaxError:Unexpected end of JASON input error' when I want to edit an order.

When I revert to:

 #RewriteCond %{HTTP_HOST} domainname\.com [NC]
 #RewriteCond %{SERVER_PORT} 80
 #RewriteRule ^(.*)$$1 [R,L]

the error goes away and I can edit. But in this case, the website is not secure anymore and an unsafe sign appears at the top left side of the browser next to the address section.

I want to keep the site at https and still edit the orders. Can anyone help? Thank you...!