When I try to navigate to my site any domain I enter under https it takes me to the site specified in the VirtualHost config provided. I have setup the ServerName but it still doesn't work. So if I enter https://storage.example.com/ it takes me to the site as expected but when I enter anything else such as https://ab.example.com/ it still takes me to the previous site. Why does this happen?
<VirtualHost *:80>
ServerName storage.example.com
#Redirect permanent / https://storage.example.com/
RewriteCond %{HTTP_HOST} ^storage.example.com
RewriteRule ^(.*)$ https://storage.example.com$1 [R,L]
</VirtualHost>
<VirtualHost *:443>
Alias /files /var/www/files
ServerName storage.example.com
DocumentRoot /var/www/nextcloud/
<Directory /var/www/nextcloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
</Directory>
# SSL
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/storage.example.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/storage.example.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/storage.example.com/fullchain.pem
Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains;"
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>