.htaccess user Authentication problems.

  • PluTunium
  • Professor
  • Professor
  • User avatar
  • Posts: 812
  • Loc: Touring the USA

Post 3+ Months Ago

I am trying to create a password protected directory with .htaccess. My host supports these kinds of files, and allows them.

Now my problem is I do all the coding correct (supposedly) and then upload it to the correct files, and then the directory i want should be password procteced. For some reason, it is not working.

Here is the code i am using for the .htaccess file

Code: [ Select ]
AuthName "passworded area"
AuthType Basic
AuthUserFile http://www.plutunium.com/testp/.htpasswd
Require valid-user
  1. AuthName "passworded area"
  2. AuthType Basic
  3. AuthUserFile http://www.plutunium.com/testp/.htpasswd
  4. Require valid-user


I put the .htpasswd file where it is supposed to be, but it still doesn't work.

The login screen pops up, I put in the correct username and password, I hit enter, and it just goes right back to the login screen without my password.

Help please? What am I doing wrong?

I tried google, and many sources. I just can't find out what's wrong.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

right off hand, your AuthUserFile should be a server path, not a url. Also, you might want to encapsulate your require in a Limit Get, ie:
Code: [ Select ]
AuthUserFile /server/path/to/testp/.htpasswd
AuthName "passworded area"
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>
  1. AuthUserFile /server/path/to/testp/.htpasswd
  2. AuthName "passworded area"
  3. AuthType Basic
  4. <Limit GET POST>
  5. require valid-user
  6. </Limit>

Also, as a side note, you have to make sure your passwords are hashed in your .htpasswd file, they cannot be clear text. Depending on your server (if it's *nix or Winblows) there are different methods for doing this.
for a *nix server, go to http://www.kxs.net/support/htaccess_pw.html
and generate your password,
For Win32, it depends on which server you're running, but for Apache, you need to run the htpasswd.exe in the Apache/bin directory
  • PluTunium
  • Professor
  • Professor
  • User avatar
  • Posts: 812
  • Loc: Touring the USA

Post 3+ Months Ago

Thanks for your help. I will try that now.
  • SharkShark
  • Guru
  • Guru
  • User avatar
  • Posts: 1013
  • Loc: Living In Today

Post 3+ Months Ago

There are at least two other thread that deal with the same problem. Do an Ozzu search for .htaccess.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: Liamw411 and 41 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.