2

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!!

1
  • i tried with if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on'; but didn't work!!
    – Mace Long
    Commented Jun 22, 2016 at 12:39

1 Answer 1

2

Under System>Config>Web>General>Secure

You need to set the Use Secure URLs in Frontend and Use Secure URLs in Admin to yes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.