Перенаправление http в https

a2enmod rewrite
systemctl restart apache2
mcedit /etc/apache2/sites-enabled/000-default.conf
...
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</VirtualHost>