I am runnning apache on SuSE 7.2 pro,
I have several Virtual hosts all working correctly - I want to password
protect one of the directories. but it doesnt want to work. I have added
into the httpd.conf as follows
<VirtualHost 212.19.66.163:80>
ServerAdmin someone
DocumentRoot /usr/local/httpd/htdocs/sites/mysite/
ServerName mysite.com
ErrorLog logs/error.log
CustomLog logs/access_log common
<Directory forsale>
AllowOverride AuthConfig
</Directory>
</VirtualHost>
and in the forsale directory I have the following .htaccess file
AuthType Basic
AuthName "Restricted Directory"
AuthUserFile .htpasswd
Require Valid-user
I have 2 users in the .htpasswd file and the Apache server is configured to
block requests for .ht* files
<snip>
AccessFileName .htaccess
#
# The following lines prevent .htaccess files from being viewed by
# Web clients. Since .htaccess files often contain authorization
# information, access is disallowed for security reasons. Comment
# these lines out if you want Web visitors to see the contents of
# .htaccess files. If you change the AccessFileName directive above,
# be sure to make the corresponding changes here.
#
# Also, folks tend to use names such as .htpasswd for password
# files, so this will protect those as well.
#
<Files ~ "^\.ht">
Order deny,allow
Deny from all
</Files>
Can anyone tell me where I am going wrong?
Mike.
>> Stay informed about: I cant get .htaccess to work