Broken pages after SSL been installed on Apache?


#1

hi guys, after running this tutorial:

My ssl serves broken page, how to fix it?


#2

Try checking your site with: https://www.whynopadlock.com/

or provide a more detailed explanation (picture) of the problem.


#3

hi, thanks for a fast response.

Domain is: https://locksmithboys.com/

I run Ubuntu 18.04

Server version: Apache/2.4.29 (Ubuntu)
Server built: 2018-06-27T17:05:04

I ran your test on https://www.whynopadlock.com/results/d1badf9b-b9f3-47d7-b880-967d7344799b

and just added:

RewriteCond %{HTTP_HOST} locksmithboys.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://locksmithboys.com/$1 [R,L]

into .htaccess file but still same issue.

History:

I installed certificate via:

all I ran was :

$ sudo certbot --apache

I can attach/paste files off etc/apache2/sites-available or

etc/apache2/site-enabled folder…

Which ones?


#4

Hi @grx7

you have terrible mixed content warnings / blocks.

Use FireFox / Chrome, then Ctrl + Shift + I, open the Console.

https://209.97.176.152/wp-includes/js/jquery/jquery.js?ver=1.12.4

Loading this page says:

SSL_ERROR_BAD_CERT_DOMAIN - certificate only valid with locksmithboys.com

Never load content via an ip address.

Change these links to relative links

/wp-includes/js/jquery/jquery.js?ver=1.12.4

or correct absolute links:

https://locksmithboys.com/wp-includes/js/jquery/jquery.js?ver=1.12.4

Then the browser loads these scripts -> your page will work.


#5

it’s a standard message from WP by default. I didn’t touch it.

Check http://www.locksmithboys.com/


#6

As Juergen said you can’t load parts of a secure page by IP address, it just doesn’t work.

Somewhere in the wordpress settings you gave it the 209.97.176.152 IP address instead of the locksmithboys.com domain name. I think it’s under settings -> general settings. The same settings page has the site title and tagline settings. Wordpress shouldn’t have the IP address in any of it’s settings.


#7

you nailed it :slight_smile:

thanks a lot. it works now.

After changing it in WP admin Settings–> General it works fine

Would you guys recommend I keep my .htaccess to always redirect towards https?


#8

Happy to see you fixed your mixed content warnings.

If your certificate works and if you are sure you can check the renew (no expired certificate): Yes, a redirect is good.

Better is the HSTS header, excellent is the preload directive (HSTS per browser).


#9

thanks Juergen!

I saw this in regards to auto renewing the SSL certificate:

https://community.letsencrypt.org/t/renew-letsencrypt-certificate/34677/3

but

shows that I need to run:

$ sudo certbot renew --dry-run

How do you guys auto renew yours?


#10

–dry-run has some limitations and uses the testsystem. So if you want to renew your certificates,

sudo certbot renew

is correct.

I have my own client :wink:


#11

thanks for helping out guys.


#12

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