I'm having the problem of double authentification on my Apache server like he has: Properly Force SSL with .htaccess But I want to do this via the conf files. He says he knows how to do it via conf files, but didnt explain further. I have two config files, both are activated.
<VirtualHost *:80>
Redirect permanent / https://example.com/
ServerName example.com
ServerAlias www.example.com
ServerAdmin admin@example.com
DocumentRoot /var/www/example.com/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
_
DavLockDB /var/www/DavLock
<VirtualHost *:443>
#Webdav
Alias /webdav /var/www/webdav
<Directory /var/www/webdav>
DAV On
AuthType Digest
AuthName "My File Storage"
AuthUserFile /etc/apache2/users.password
Require valid-user
</Directory>
#SSL
ServerName example.com
DocumentRoot /var/www/example.com/
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem
What am I doing wrong, why do I get double webdav-Window when connecting to http://example.com/webdav
?
The authentification window is even telling me that https:// example.com is asking for username and password.
I had an rewrite from www to non-www and http to https working via conf files, but I am not sure what happened to my confs and why it is broken now. All I did was a2enmod a new site and then a2dismod the same site afterwards...