Magento – SSL error when on product page

httpsmagento-1.9ssl

When on my homepage and any page other than product pages my SSL works perfectly. When you load a product page the SSL breaks and I see this message in my console:

The page at 'https://www.mywebsite.com/product-page.html' was loaded over HTTPS, but is submitting data to an insecure location at 'http://www.mywebsite.com/checkout/cart/add/uenc/aHR0cDovL3d3dy5uaXRyb3V…p6bGUtc3lzdGVtLmh0bWw_X19fU0lEPVU,/product/1347/form_key/bWcN0O9kodteC8FG/': this content should also be submitted over HTTPS.

I have done the typical base urls settings in magento and quadruple checked sure https is set for the secure base url. I also enable ssl in htaccess file using this:

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.mywebsite.com/$1 [R=301,L]

How can change the unsecure location URL? The cart page etc loads with the SSL.

Magento ver. 1.9.0.1

Thank you for your help!

Best Answer

I wouldn't recommend you to use the ".htaccess" method to force your Magento store to use HTTPS.

What you can do instead is just to change both your Secure and Unsecure Base URL to HTTPS and make sure to remove the ".htaccess" redirect rules.

With both the Secure and Unsecure Base URL with HTTPS, the buttons generated should be running HTTPS as well unless they are hard coded somehow (not likely).