After certificate installation css stop working

Hello,
I use certbot to install Let’s Encrypt certificate and make it redirect all 80 to 443, but after the installation the stopping working.

My domain is:
http://jceos.com

I ran this command:
certbot --apache -d jceos.com -d www.jceos.com
and chose option 2: Renew & replace the cert (limit ~5 per 7 days)

It produced this output:
IMPORTANT NOTES:

  • Congratulations! Your certificate and chain have been saved at…

My web server is (include version):
Apache/2.4.6 (CentOS)

The operating system my web server runs on is (include version):
CentOS Linux release 7.5.1804 (Core)

My hosting provider, if applicable, is:
locaweb

I can login to a root shell on my machine (yes or no, or I don’t know):
Yes, I can.

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):
I’m not using it.

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):
certbot 0.35.1

It looks like your content management system is not playing nice with HTTPS.

For example, your CSS resources are just loading the website instead of the CSS files. Try visiting https://jceos.com/catalog/view/javascript/bootstrap/css/bootstrap.min.css

I’m not sure whether people on this forum would be able to tell you what is going wrong. You may wish to revert the HTTP to HTTPS redirect so that you can investigate the issue. You can do this by locating and then removing the redirect from your /etc/httpd/ directory.

2 Likes

Hi @lipesmile

your certificate configuration is correct. But the handling of these additional files is completely wrong.

Not only CSS, same with images:

https://jceos.com/image/cache/catalog/Testadores/HP%209000-1140x380.jpg

shows html-content, no image.

and js files:

https://jceos.com/catalog/view/javascript/bootstrap/js/bootstrap.min.js

It's a configuration problem of your webserver or CMS you have to fix.

1 Like

I notice there’s some http:// references in the page source calling external resources… Should be https:// … ?

I can't see something - https://check-your-website.server-daten.de/?q=jceos.com#html-content

There are some outgoing http links. But these are not ressources (css, js, images).

Resources are relative or with https.

But images, CSS and JS files send the home page, not the image / CSS / JS content.

So the page doesn't have CSS and images.

Initially I discovered 5 references to href="http:// in the source… now it looks like only the “Powered By” credit refers to http:// (sorry for the chatter)

As written: There are outgoing http links. But that's not a problem. A https page can have outgoing http links.

Open one of the images or css files in your browser. Then you see html code, that's bad.

So a general configuration is wrong.

Agreed.
However,

This is a link, not an image:

<a href="http://jceos.com/opencart/upload/index.php?route=product/product&amp;path=65&amp;product_id=51"><img src="https://jceos.com/image/cache/catalog/ArgaFast/Argafast01-1140x380.jpg" alt="Assentador" class="img-responsive" /></a>

Looks like these links can change.

I made a restore from a server image, so verified if the http works normally, after that I install the letsencrypt and the certificates, www and non www, I’ve followed the tutorial to install SSL in the CMS, but when certificates installation had finished I didn’t choosed the option to make redirect from http to https. I searched and I made it work parcially. Now is redirecting http www and non www to https non www. The problem is in a specify directory, the https is working, but not the redirect from http to https and from www to non www.

My .htacessis now:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.(.*) [NC] RewriteRule ^(.*) https://%1/$1 [R=301,L]

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.