I have already tried different solutions from other threads but somehow none is working. So I have a domain called my-domain.com and I want that all http requests to http://my-domain.com or http:///*.my-domain.com are redirected to the corresponding https page. In the folder /etc/apache2/sites-enabled/ I have a configuration file which looks like this:
<VirtualHost *:80>
ServerName my-domain.com
ServerAlias *.my-domain.com
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.+)\.my-domain\.com$
RewriteRule ^(.*)$ https://%1.my-domain.com/$1 [R=302,L]
</VirtualHost>
But still there are no redirects. All requests are failing because of a timeout. Is there something I am missing?