ServerAdmin ${APACHE_SERVER_ADMIN} ServerName ${SERVER_NAME} DocumentRoot /var/www/certbot RewriteEngine On RewriteRule ^/$ https://%{HTTP_HOST}/ [L,R=301] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] Require all granted AllowOverride All Options -Indexes