Say I have the following Vhost definition in Apache2
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName dummy.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/dummy
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
ServerAlias www.dummy.com
SSLCertificateFile /etc/letsencrypt/live/dummy.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/dummy.com/privkey.pem
</VirtualHost>
</IfModule>
<IfModule mod_ssl.c>
<VirtualHost *:80>
ServerName dummy.com
ServerAlias www.dummy.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/dummy
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
Redirect permanent / https://www.dummy.com
</VirtualHost>
</IfModule>
If I type
it redirects to
But if I type
http://www.dummy.com or just www.dummy.com
It redirects to
that is not a valid url.
what in the vhost configuration is causing this? I cannot see where I should look for to debug and solve the issue since the vhost doesn't contains this rewrite rule