Question

Not a clean Let'sEncrypt SSL install. Website's internal links won't https automatically.

Did a Wordpress one-click-install and migrated my website. After everything was setup I tried installing Let’s encrypt SSL and faced few interruptions like console freezing up, python-certbot-apache not found, multiple v-host issue etc. I managed to install the SSL for both domain.com and www.domain.com and the SSL labs test for both verify that the SSL certificates are working. When I enter domain.com and press enter, it automatically changes to https://www.domain.com, all good. Certbot renewal dry run works fine too.

Now here is the problem, all the internal links in the page pointing to www.domain.com still stay http and wont automatically change to https. I can force https through wordpress plugins but I am not sure if this is the right way. Neither do I know if the SSL certificate for www.domain.com has been installed correctly. How do i fix this?

This is my default.conf file if needed

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        <Directory /var/www/html/>
            Options FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

And this is my 000-default-le-ssl.conf file

IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    <Directory /var/www/html/>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerName domain.com
Include /etc/letsencrypt/options-ssl-apache.conf
ServerAlias www.domain.com
SSLCertificateFile /etc/letsencrypt/live/domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem
</VirtualHost>
</IfModule>