Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.htaccess doesn't work

Status
Not open for further replies.

theom

Programmer
Feb 22, 2001
28
NL
Hi, I have a problem with an .htaccess which I can't get to work. I have tried everything but it is driving me nuts. I'm sure it must be a minor thing but it has taken me hours and hours, and I still can't get it to work.
The problem is that the no username/password box is coming up when I browse a file in the protected directory.

The details:
RedHat 8.0, Apache 2.0.40
The dir is /var/
.htaccess:
AuthUserFile /home/tm/.htpasswd
AuthName "Password required"
AuthType Basic

The .htpasswd file has the correct attributes (+r), dir /home/tm also (+x)

httpd.conf:
...
<Directory &quot;/var/ AllowOverride All
Order allow,deny
Allow from all
</Directory>
...

IE version 6.0, security options:
User Authentication = Prompt for user name and password

The result stays the same when I change it to other options.
All files can be accessed in the 'protected' dir.

The .htaccess file is being read, when I put garbage in it, I get an error message in IE and the logfile.

I have changed .htaccess to the following:
AuthUserFile /home/tm/.htpasswd
AuthName &quot;Password required&quot;
AuthType Basic
<Limit GET POST>
Require user admin
</Limit>

The result is that I cannot access any file in the dir, I get an error message in IE:

Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

But no password box is shown in IE!

Help, I'm lost!
 
Make sure permissions are ste on the .htaccess file such that your Apache user/group can read them. And try
require valid-user

instead of what you have there.
 
Yes, that's the trick (valid-user). Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top