http to https rewrite
1. Use the command:
a2enmod rewrite
2. Find inside the directory /etc/apache2/sites-available/ .conf file that serves your domain (check ServerName or DocumentRoot directory);
3.Add a SEPARATE block:
<VirtualHost *:80> ServerName <domena> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,QSA] </VirtualHost>
4. Use the command:
service apache2 restart