Magento 1.9 css and js not load with https
-
30-09-2020 - |
Question
when I enable free SSL in cloud-flare, my magento website stops loading properly. Basically CSS and JS doesn't load but without HTTPS the website works fine, but with HTTPS website does not load CSS and JS. I tried with below code in index.php, but didn't work.
if (isset($_SERVER['SERVER_PORT']) && (443 == $_SERVER['SERVER_PORT'])) $_SERVER['HTTPS'] = 'on';
Please help!!
Solution
Under System>Config>Web>General>Secure
You need to set the Use Secure URLs in Frontend and Use Secure URLs in Admin to yes.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange