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

-2

I installed a SSL certificate on a site. The certificate is running normal. The problem is that in the mobile version of the site CSS is not loaded, on the other hand, in the desktop version the CSS is loaded normally. I suspect the problem is in htaccess. Here is the .htaccess code I'm 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 in another site that also installed the same certificate, and CSS loaded correctly on both devices. I would like to know if someone has gone through something like this and can help me solve this problem.

    
asked by anonymous 20.08.2018 / 22:48

1 answer

1

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

And so, the browser complains that it has mixed http 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">
    
21.08.2018 / 13:06