.htpasswd
Posted by: nateharper (69.91.34.---)
Date: October 25, 2006 04:42AM

im trying to password protect a folder in a sub folder of www, so i want to password protect the folder 1 and on my computer it is at E:/wamp/www/folder/1. so where would i put the .htaccess file with all the code in it and where would i put the .htpasswd file? i think i have the code but i can never be sure until it starts working.

thanks for all you help.

Options: ReplyQuote
Re: .htpasswd
Posted by: CyberSpatium (71.237.217.---)
Date: October 25, 2006 01:15PM

put the .htaccess file in the directory you want to protect. you need to make a folder outside your web root for your .htpasswd file like e:\wamp\pwds. it is very important you put your .htpasswd file outside your web root so it is not accessible to anyone accessing your website.

Options: ReplyQuote
Re: .htpasswd
Posted by: nateharper (69.91.34.---)
Date: October 25, 2006 11:29PM

ok so i put the file in e:\wamp\.htpasswd. so what is the system locataion thing for it? like what do i put in the .htaccess file as the location?

thanks for all you help

Options: ReplyQuote
Re: .htpasswd
Posted by: yfastud (---.cable.mindspring.com)
Date: October 26, 2006 12:01AM

Below is the basic code. After testing if it works, you should cofigure more to meet your desire.

// file .htaccess
AuthUserFile e:/wamp/.htpasswd
AuthName "Private Area"
AuthType Basic
<Limit GET POST>
require valid-user
</Limit>

// file .htpasswd
username1:password1
username2:password2

Replace username and password with your real/testing ones.

Hope this help

Options: ReplyQuote
Re: .htpasswd
Posted by: nateharper (---.cable.mindspring.com)
Date: October 26, 2006 12:28AM

i have put the .htpasswd file in e:\wamp and the .htaccess file is in e:\wamp\www\folder.
i loaded 127.0.0.1\folder (the index) and it poped up the username/ password box. yay. but wait i put the username and password ( the file had been put through an encreption web site) and hit enter. well it just poped the password and username box back up again.

did i do something wrong again? the password is all jumbled up and encripted but i think i did everything right.

also if the web page ever went live, i dont think an 401 authenorization page to pop up, so do you know how to direct it to another page if the authenakation fails?

thanks

Options: ReplyQuote
Re: .htpasswd
Posted by: yfastud (---.cable.mindspring.com)
Date: October 26, 2006 12:37AM

You should do the basic step as my suggestion first to make sure it works before put the file through encription website

Hope this help

Options: ReplyQuote
Re: .htpasswd
Posted by: nateharper (69.91.34.---)
Date: October 26, 2006 12:50AM

do u mean just not putting it through the encription site and enter the password without any encription?

Options: ReplyQuote
Re: .htpasswd
Posted by: yfastud (72.236.169.---)
Date: October 26, 2006 02:25PM

Yes, as already mentioned, to make sure it works first so you don't confuse the code doesn't work or encryption causes the problem, and if it works you should see something similar to this:

[xalbum.jlbn.com]

Username: tester
Password: test

Hope this help



Post Edited (10-26-06 17:06)

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: .htpasswd
Posted by: CyberSpatium (71.237.217.---)
Date: October 26, 2006 04:03PM

your passwords in your .htpasswd file need to be encrypted.

use this page to create user name and passwords for you .htpasswd file
[www.flash.net]

for example, if I enter test as the user name and test as the password, I get this:
test:A9LSEAymdJNkA

put that in your .htpasswd file.

Options: ReplyQuote
Re: .htpasswd
Posted by: nateharper (---.cable.mindspring.com)
Date: October 29, 2006 02:10AM

ok i can get it to work.

do you know how to set a page to go to if the password is false or not given?
thanks

Options: ReplyQuote
Re: .htpasswd
Posted by: CyberSpatium (71.237.217.---)
Date: October 29, 2006 08:12AM

you need to use php to code a script to handle that



CyberSpatium
English Forum Admin

Options: ReplyQuote


Sorry, only registered users may post in this forum.