Assuming that your /usr/etc/.htpasswd
file is accessible and valid (created properly with htpasswd
command and chmoded to 644
) your sample should work for Apache 2.2
, but not in Apache 2.4
according to comments in this post. Literally in 2.4
it will work, but will require password also for your root domain.
There are two solutions. First is placing additional .htaccess
files in your typo3
directory with simple rule, i.e. as shown by @Naderio:
AuthType basic
AuthName "Secret area!"
AuthUserFile /usr/etc/.htpasswd
require valid-user
Order deny,allow
Deny from all
Satisfy ANY
However, if you created a typo3
symlink to sources as suggested in TYPO3's documentation and/or you don't want to require BasicAuth for all projects which uses the same sources, you can override these settings directly in VHOST configuration like (assuming that you have all your TYPO3 projects i.e. in /www/typo3/
folder:
<VirtualHost *:80>
ServerAdmin your@email.tld
DocumentRoot "/www/typo3/project-x.loc"
ServerName project-x.loc
# below your valid paths for log files...
# ErrorLog "logs/project-x.loc-error_log"
# CustomLog "logs/project-x.loc-access_log" common
<Directory "/www/typo3/project-x.loc">
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Require all granted
</Directory>
<Directory "/www/typo3/project-x.loc/typo3">
AuthType basic
AuthName "Restricted in VHOST config!"
AuthUserFile /usr/etc/.htpasswd
require valid-user
Order deny,allow
Deny from all
Satisfy ANY
</Directory>
</VirtualHost>
Note: I'd check anyway if the path you are trying to use /usr/etc/
is accessible for Apache at all, maybe it will be better moving your .htpasswd
file somewhere closer to your www
structure like to folder /www/etc/
and fix the above rules accordingly?