I'm trying many different configurations following many tutorials and documentations, I can't get the authentication without creating thousands .htaccess files.
Here is my configuration :
<VirtualHost *:443>
DocumentRoot /home/user/www
ServerName preprod.user.com
<Directory /home/user/www>
Options Indexes SymLinksIfOwnerMatch
AllowOverride All
AllowOverride FileInfo AuthConfig Limit
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile /etc/ssl/private/preprod.user.com.crt
SSLCertificateKeyFile /etc/ssl/private/preprod.user.com.key
</VirtualHost>
And at the root level, I wrote this /home/user/www/.htaccess file :
AuthType DIGEST
AuthName "preproduction"
AuthDigestNonceLifetime 1
AuthDigestDomain "/home/user/www/" "https://preprod.user.com/"
AuthDigestProvider file
AuthUserFile "/web/auth/.digest_pw"
Require valid-user
The result is :
https://preprod.user.com/ asks for a password
https://preprod.user.com/v1/ asks for a password
BUT :
https://preprod.user.com/v1/index.php <strong>doesn't ask for password</strong>
Thank you all