Use certbot
./certbot-auto renew --dry-run
...
./certbot-auto renew --quiet --no-self-upgrade
$ ./certbot-auto --apache
DON'T FORGET TO CREATE A BACKUP OF THE CERTIFICATIONS WHEN THEY'RE DONE. JUST IN CASE YOU KNOW :)
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]