0

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.

6
  • Did you change the base URLs in Magento Admin to https as well? What does your configuration look like? Commented Feb 22, 2018 at 9:20
  • tried to change admin to secure but than got thrown out so switched back admin to unsecure. frontend is secure but css errors and links not working. Commented Feb 22, 2018 at 9:23
  • You need to update all URLs to https and then clear the cache. Commented Feb 22, 2018 at 9:24
  • Also: If you want to serve the whole shop via HTTPS also set: "Use Secure URLs on Storefront" to Yes. Commented Feb 22, 2018 at 9:25
  • they need to update automatically. what do you mean? Commented Feb 22, 2018 at 9:26

1 Answer 1

1

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.

6
  • Enable HTTP Strict Transport Security (HSTS): Yes Upgrade Insecure Requests: Yes. are not showing up on web section Commented Feb 22, 2018 at 9:50
  • maybe i have premissions issue? Commented Feb 22, 2018 at 9:54
  • You need to save the secure base url first and then reload the page. Then the 2 options will show up. Commented Feb 22, 2018 at 10:05
  • they dont show up.. Commented Feb 22, 2018 at 10:38
  • Which version of Magento 2.x is this? Actually they should show up. However, these 2 are security features which should be enabled when you run your shop via https but they have nothing to do with the fact that CSS is loaded via https in the frontend. Commented Feb 22, 2018 at 12:36

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.