I have the following .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.de [NC]
RewriteRule ^(.*)$ http://www.example.de/$1 [L,R=301]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
AuthType Basic
AuthName "Access to /www.example.de"
AuthUserFile /myfolder/homepages/10/d563344564/htpasswd
Require user admin
If I reach example.de the system asks me the password twice (I guess the first for example.de and the second for www.example.de). But this happens also when in some images are loaded (the src attribute contains the link with www, but probably it is already changed because of .htaccess). Which way can I follow to have just one password request at the beginning?