Magento – After Enabling SSL magento still loads default Javascript and CSS files with unsecure URLs

magento-1.9ssl

I enabled SSL in magento through following system configuration settings:

System > Configuration > General > Web > Secure > Use Secure URLs in Frontend > Yes

System > Configuration > General > Web > Secure > Use Secure URLs in Admin > Yes

System > Configuration > General > Web > Secure > Offloader header > SSL_OFFLOADED

System > Configuration > General > Web > Secure > Base JavaScript URL > {{secure_base_url}}js/

Above setting completely breaks the frontend and gives the error Blocked loading mixed active content because all the Javascript and CSS files are being loaded through unsecure URLs using http. My {{secure_base_url}} is having https and a trailing slash.

These settings also leave the admin panel inaccessible as it gives the error "This page is not redirecting properly" when accessing backend.

I am aware, similar questions have been asked here before and I tried all the solutions, but none of it is working.

I can make it work temporarily by forcefully changing unsecure URLs to secure ones. But this is not the best way. Ideally, when the request is on https, Magento automatically takes the secure Javascript and CSS URLs.

Any idea why this is happening ?

Best Answer

Please also update

System > Configuration > General > Web > Unsecure > Base URL

It should be https://www.example.com/ And add this code in .htaccess

#enable website to run https 
        RewriteCond %{HTTPS} off
        RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

And flush your Magento cache. For "Blocked loading mixed active content" open firebug console, it will tell which file is causing this error. If you are using static URL then you need to change it manually from http:// to https:// for more information on this visit here.