Magento – Magento CSS files not loading with https url

csshttpsmagento2ssl

I have installed SSL certificate and now when I access the website link to secure website CSS files are not loading.
CSS files are loading in not secured url . Also url links inside the website returning 404:

Please help me solve this issue.
I tried to deploy but that did not help.

Best Answer

Make sure your configuration looks like this:

Stores > Configuration > General > Web:

Base URLs:

Base URLs (Secure):

  • Secure Base URL: https://www.yourdomain.com/
  • Secure Base Link URL: {{secure_base_url}}
  • Use Secure URLs on Storefront: Yes
  • Use Secure URLs in Admin: Yes
  • Enable HTTP Strict Transport Security (HSTS): Yes
  • Upgrade Insecure Requests: Yes

After changing the URLs, clear the cache! You might as well need to a new deployment and/or run bin/magento setup:static-content:deploy and clear the cache again.

Related Topic