View Full Version : .htaccess on win32
tacmig99
01-03-2007, 09:19 PM
AuthName "View ReadMe For Access"
AuthType Basic
AuthUserFile C:\wamp\.htpasswd
AuthGroupFile /dev/null
require user admin
My server is set up so everything is in me WWW folder like this C:\wamp\www\index.php
But when I try to access a password protected area it can't seem to find the .htpasswd file to match the user and pass so no one can view the area.
I have done this before and worked, the only difference was I used Linux and now I am using WinXP so the only conclusion I can think of is my AuthUserFile is pointing to the wrong file which it isn't.
Any and all help appreciated.
Are you sure you named it .htpasswd? Windows doesn't usually like "odd" filenames (things with a full stop as the first character, for example) and a lot of programs will attempt to append their own extensions (.htpasswd.txt, for example).
Also (I'm not very familiar with Apache on Windows, so this may be entirely wrong) but I don't believe /dev/null exists on Windows.
thetestingsite
01-04-2007, 02:04 AM
Are you sure you named it .htpasswd? Windows doesn't usually like "odd" filenames (things with a full stop as the first character, for example) and a lot of programs will attempt to append their own extensions (.htpasswd.txt, for example).
This is true, but there is a fix around it. To make it to where you can make .ht* files you would need to go to any folder on your computer. At the top, click on "Tools", then "Folder Options". After that, click on the "View" tab at the top and in there find a checkbox with the following option next to it:
Hide extensions for known file types.
Uncheck the box, click "Apply" or "OK" (either will save the setting), then try making a .ht* file.
Hope this helps.
tacmig99
01-04-2007, 03:10 AM
Thanks but my .ht files seem to be fine.
Also (I'm not very familiar with Apache on Windows, so this may be entirely wrong) but I don't believe /dev/null exists on Windows.
I was wondering about that too since windows uses slashes going the other direction usually, I don't even know what it's for though, is it safe for me to remove it?
/dev/null is a device file on Linux that simply discards all data written to it. Anything read from it will be empty. If you want to simulate the effect, try creating a blank file and pointing to that (the correct analogue on DOS/Windows is the device NUL, but I've no idea how one would refer to it).
BLiZZaRD
01-05-2007, 03:55 AM
You say you have it set up as thus:
My server is set up so everything is in me WWW folder like this C:\wamp\www\index.php
Yet your htaccess file (check for the .htaccess.txt problem here too, not just your .htpasswd) says:
AuthUserFile C:\wamp\.htpasswd
if your passwd file is ALSO in the WWW folder you need to tell it so ;)
<edit>
Looking at my own .htaccess files I saw a couple differences... might be nothing, but try this:
# Begin password protection #
AuthName "View ReadMe For Access"
Require valid-user
AuthUserFile C:\wamp\.htpasswd
AuthType basic
# End password protection #
</edit>
ejcaputo
04-30-2010, 04:40 PM
I found that under Apache 2, in Windows, it uses a more standard algorithm for the passwd. This web (http://www.htaccesstools.com/htpasswd-generator/) uses the MD5 algorithm, and it works on my system, whereas the algorithm in this web didn't work.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.