PDA

View Full Version : password



spyder
08-16-2005, 02:56 AM
i am trying to do this http://tools.dynamicdrive.com/password/ but cannot figure it out. right now, i have an .htaccess in my root which contains the following



ErrorDocument 404 http://willie.envisionssoftware.com/web/home1.html
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /pages/protect/.htpasswd
AuthGroupFile /dev/null
require valid-user


then i have a .htpasswrd which is located from the root at pages/protect/.htpasswrd in the folder protect, i have a html document named test, and the .htpasswrd which contains



user:2mfVm7JMw2ZB6


on my home page which is located in pages/home.html i have a link which is to protect/test.html when you click on this link, it takes you to the page without makeing you put in a user name or password.

1 thing i did notice is that both htaccess, and htpasswrd are .txt files.

thank you in advance.

p.s. can you have multiple .htaccesses?

Twey
08-17-2005, 07:11 PM
The .htaccess/.htpasswd files should not have extensions. If you name them .htaccess.txt or .htpasswd.txt, they're not .htaccess and .htpasswd, are they?

There is no need to have multiple .htaccess files in the same directory; you can put as many instructions as you like in a file.

spyder
08-17-2005, 09:20 PM
thanks, i will try that. they became.txt files when i saved automatically. i will try this. thank you very much for the help.

byork
02-28-2008, 04:44 PM
Hello,
I know this is an old post, but I hope someone will see it.
I have the .txt problem, also. I followed instructions in another post, that explains to go to Tools in a folder, and hide extensions. My folder is set that way, but after I uploaded it shows the .txt in the file.
I am not sure what to do at this point.
Any ideas?

thanks so much for reading this.
Viki

djr33
02-28-2008, 09:22 PM
make a new php file and include this code; place it in the folder and run this once, then delete the file:

<?php
if (file_exists('.htaccess.txt')) { echo rename('.htaccess.txt','.htaccess')?'It worked!':'Something went wrong'; }
?>

Really, though, I recommend finding out how to properly use a file manager (though windows makes this annoying) so you don't have to worry about it.

Rather than HIDE extensions, you DO want to show them. You may need to manually rename the file after using notepad, but if you show extensions and remove it (after clicking ok on "do you really want to remove this extension" or whatever warning pops up), you should be ok.