PDA

View Full Version : .htaccess problem


Masterslave
12-21-2005, 09:30 AM
Hello guys,

I've a problem with securing a folder on my site. I've made a .htpasswd file with Linux Debian. I've entered "htpasswd -c .htpasswd patrick" and then I've entered my password twice.
Then I've made a .htaccess file with the following lines:

AuthName "Restricted Area"
AuthType Basic
AuthUserFile d:/easyphp1-8/www/patrickkraaij/htaccess/.htpasswd
AuthGroupFile /dev/null
require valid-user

Below this text are the lines from the .htpasswd

patrick:QUdEUoUIlnZHM

I've put the two files in the right directory as given in the .htaccess file.
When I browse to that location, the broswer prompt and give me a Login screen, so far so good. When I enter the usr "patrick" and the password given in the .htpasswd it does not match, I get a redirect and I must login again, so it doesn't work, I don't get it.

I've also tried this tutorial http://www.mousewhisperer.co.uk/htaccess_page.html
And it does the same, I can't login. It drive me nuts!:(

Do I have to enable something in the php.ini file or something?
I've search the forum but I couldn't find something useful.

firepages
12-21-2005, 11:44 AM
you created the .htpasswd on linux and are using it on windows ? if so that in itself is probably the problem, windows is probably using a different encryption/hash routine than on linux there are usually more options for encryption/hashes on *NIX than win32

if you are using apache on win32 then look in the /apache/bin/ directory, there should be a htpasswd.exe binary in there , use that to create your password file (as you did in debian).

Masterslave
12-21-2005, 12:02 PM
Yes, you're right, I've created the file on Linux and I'm using it on Windows.
But when my site is finished, I'll upload it to a hosting that uses Linux.
ATM, my site is running under my localhost on Windows because it isn't finished yet.

So, when I using the htpasswd.exe, it will work on Windows but not on Linux I guess? I'll try it after the lunch. :D

Thanks anyway, I'll post it when it worked.

Masterslave
12-21-2005, 12:20 PM
Thanks firepages it works! :thumbsup:
Anyway, when my site goed live, it is hosting on a Linux system.
I've to replace my .htpasswd file for a Linux version of it right?

firepages
12-21-2005, 01:32 PM
when my site goed live, it is hosting on a Linux system.
I've to replace my .htpasswd file for a Linux version of it right?

Basically yes , there are probably ways to have a shared password file that would work on both but that would require more messing around than its probably worth.