find .htaccess password directory

Problems with the Windows version of XAMPP, questions, comments, and anything related.

find .htaccess password directory

Postby hgtwn » 19. March 2005 06:13

I am trying to set up .htaccess using xampp-windows. my website is located at http://127.0.0.1/mysite/index.php and i put both the .htaccess and .htpasswd files in the mysite folder. I need help specifying what directory to find the .htpasswd file on the server. no matter what i put as the address it doesn't find it. also, it doesn't seem to find any of the error pages either, they are both in the same "mysite" dir too. any suggestions? here is my .htaccess text:

ErrorDocument 404 /notfound.html
ErrorDocument 401 /login.html
AuthName "Restricted Site"
AuthType Basic
AuthUserFile /.htpasswd
Require valid-user

thanks for the help!

hgtwn
hgtwn
 
Posts: 13
Joined: 19. March 2005 06:05

Re: find .htaccess password directory

Postby petitprince » 19. March 2005 07:40

hgtwn wrote:I am trying to set up .htaccess using xampp-windows. my website is located at http://127.0.0.1/mysite/index.php and i put both the .htaccess and .htpasswd files in the mysite folder. I need help specifying what directory to find the .htpasswd file on the server. no matter what i put as the address it doesn't find it. also, it doesn't seem to find any of the error pages either, they are both in the same "mysite" dir too. any suggestions? here is my .htaccess text:

ErrorDocument 404 /notfound.html
ErrorDocument 401 /login.html
AuthName "Restricted Site"
AuthType Basic
AuthUserFile /.htpasswd
Require valid-user


Assuming you have an XAMPP standard installation, the .htaccess file of your scenario would read

Code: Select all
AuthType Basic
AuthName "Restricted Site"
require valid-user
AuthUserfile "../htdocs/mysite/.htpasswd"


It's the ServerRoot, not the DocumentRoot that is relevant!

petitprince
petitprince
 
Posts: 74
Joined: 10. January 2005 22:31

Postby iliad2b » 19. March 2005 08:03

this might help

at SCHOOL my home directory is blah and thus i have a file called

.htpasswd

in that file i have blah:encrypted password which is created automatically by CREATING .htpasswd using the following when login to my home directory:

htpasswd –c .htpasswd username

that command creats .htpasswd and the first user

then, then,

i create www folder with 777 permissions and inside that folder i have .htaccess file with the following stuff in it.

AuthUserFile /blah/.htpasswd
AuthGroupFile /dev/null
AuthName "school.edu me" // me = same name as the first user that was setup
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>

hope that helps

just remember that .htpasswd goes one level up from the .htaccess file, they both DO NOT go in the same directory.

example directory:
c:\blah\.htpasswd
and
c:\blah\www\.htaccess
iliad2b
 
Posts: 7
Joined: 18. March 2005 08:32

Postby hgtwn » 19. March 2005 16:02

petitprince, i do have standard installation and everything works on xampp but this feture it seems. I changed the file name to be what you said and it still did not work. I keep getting the password box to pop up but no matter what password i type in, it just keeps popping up. it is like it isn't finding the .htpasswd file so it doesnt know what the username and password should be.

right now i'm using AuthUserFile "../htdocs/mysite/.htpasswd" and it doesn't work. both my .htaccess and .htpasswd files are in the mysite folder. Any suggestions?

I got the error documents working, i guess my path for those was wrong. it should have been "/mysite/404.

hgtwn
hgtwn
 
Posts: 13
Joined: 19. March 2005 06:05

Postby petitprince » 19. March 2005 23:18

Maybe you forgot to "MD5" your passwords with htpasswd.exe?

petitprince
petitprince
 
Posts: 74
Joined: 10. January 2005 22:31

Postby hgtwn » 20. March 2005 04:13

petitprince wrote:Maybe you forgot to "MD5" your passwords with htpasswd.exe?
petitprince


yeah, i was using a password generator that i found on the internet to make me an encripted password and that didn't work. for some reason, when i used the htpasswd.exe it decided to work. so its all up and running now! thanks for the continual help with this.

hgtwn
hgtwn
 
Posts: 13
Joined: 19. March 2005 06:05


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 44 guests