CSS does not load on mobile version when installing free SSL certificate

Asked

Viewed 204 times

-2

I installed an SSL certificate https://zerossl.com/ on a website. The certificate is working normal. The problem is that in the mobile version of the site the CSS is not loaded, on the other hand, in the desktop version the CSS is loaded normally. I suspect the problem is in htaccess. Follow the . htaccess code I am using to redirect to HTTPS:

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

I used this same htaccess on another site that also installed the same certificate, and CSS uploaded it right on both devices. I wonder if anyone has been through something like this and can help me in solving this problem.

  • You can send the link of the site in question?

  • Hello Vinicius, thank you for your attention. Follow the link: https://www.camarapicui.pb.gov.br

1 answer

1


You are using the absolute path of the . css, . js files.

And so the browser accuses that it has http mixed content with https

Use relative paths.

<link rel="stylesheet"  href="/mdl/material.min.css">
<link href="/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/style.css?style=2.9" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/shadowbox-master/source/shadowbox.css">
<link rel="stylesheet" type="text/css" href="/slick-1.5.9/slick/slick.css">
<link rel="stylesheet" type="text/css" href="/slick-1.5.9/slick/slick-theme.css">
  • 1

    Thank you very much friend, it worked!. I was using a urlbase for the site. Using your suggestion worked!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.