I'm trying to setup a VirtualHost that catches all sub domains that don't many any other VirtualHosts. But with this, I keep getting the index.html and it doesn't take me to the error.php page. My OS is Ubuntu 16.04 and I haven't changed the apache.conf in /etc/apache2. My other VirtualHost is for Nextcloud running at storage.declanmarks.pw.
<VirtualHost *:80>
DocumentRoot /var/www/main
ServerName null
ServerAlias *
Redirect 404 /error.php
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I not an expert in Apache.