Firstly cuz of windows File ing system (FS) it cannot support the filename ".htaccess". you can change this in apaches config file
"httpd.conf"
U need 2 change the option "AllowOverride" option from what ever it is 2
AllowOverride AuthConfig
u need 2 change "AccessFileName .htaccess" 2
AccessFileName [what_ever].ht
(e.g webht.ht)
the .ht extension is good 2 use cuz apache blocks any1 accessing a file with that extention. then change
<Files ~ ".ht">
to
<Files ~ "*.ht">
Save ur changes and restart the server
create a file in the directory u want protected called [what_ever_u_called_the_htaccess_file].ht (eg. webht.ht)
open it and the the following lines
AuthName "Restricted Stuff"
AuthType Basic
AuthUserFile c:/pwd/not_on_web_server/rs.ht
require valid-user
now run cmd.exe (winNT/2000/XP) or command.com (win9x/Me)
and type
cd c:\progra~1\apache~1\apache\bin\
or whereever apache is located
htpasswd -c [location of where 2 put the username + pwd file] [username]
eg.
htpasswd -c c:\pwd\not_on_web_server\rs.ht admin
plz note -c command tells it 2 write a new file
2 add users just use the same command without the -c command
now reopen
[what_ever_u_called_the_htaccess_file].ht
and make it
AuthName "Restricted Stuff"
AuthType Basic
AuthUserFile [location of user+pwd file using / slash not ]
require valid-user
Save it and test it
http://127.0.0.1/restricted_dir/
and it shud request 4 a username + password
Hope this helps