Why isn't Apache redirecting to HTTPS?
1 Reply
Kudos to one of our customers (Chris) for troubleshooting and identifying the solution here.
The first thing you'll want to do is make sure you're running the following command during the SSL installation process. This should edit your Apache configuration to enable HTTPS:
sudo certbot --apache
If it's still not working after that, you may want to use a debugger to identify the issue. Per certbot's FAQ site, there are actually a few tools available to debug your HTTPS configuration:
https://letsdebug.net/ (by Alex Zorin)
https://check-your-website.server-daten.de/ (by Jürgen Auer)
https://whynopadlock.com/ (by LexiConn)
https://www.ssllabs.com/ssltest/ (by Qualys)
From this Server Fault post, you can also try adding the following line to your virtual host file (located at /etc/apache2/sites-available/
):
Redirect permanent "/" "https://www.example.com/"
Lastly, you'll want to make sure your FQDN (Fully Qualified Domain Name) is included in your list of domains for Let's Encrypt.
This other Community post lists the steps necessary to configure a FQDN: