Forum Moderators: phranque

Message Too Old, No Replies

Password protection areas with .htaccess

         

toplisek

10:31 pm on Jan 10, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have put code to protect Members secure directory like:
AuthName "Members Only"
AuthType Basic
AuthUserFile /home/secure/htpasswd/.htpasswd
require valid-user

I put file OUTSIDE public_html folder with name .htpasswd
Is this path correct to detect this password and it demands username and password to access this secured main folder.

1. How to put value of USERNAME within name .htpasswd?
2. Is this correct path outside public_html?

jdMorgan

2:57 am on Jan 11, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The correct path depends on your host.
Your host will usually also provide the encryption tool you need to use to create users and store their passwords, or can tell you the shell-script command to use.

Too many hosts do this too many different ways, so really it's best to just ask them.

Jim

toplisek

12:00 pm on Jan 11, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks
How is usualy created .passwdfile from command prompt and
the password becomes encrypted? Is this possible ONLY from hosting?

phpMyAdmin 2.11.10
and CP

jdMorgan

3:44 pm on Jan 11, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is no "usual" method. Ask your host, or see the 'help' files for your server's operating system.

Creating the password must be done on the server, because only the server has the encryption key.

Jim

toplisek

4:04 pm on Jan 11, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



ok, I managed and works. It is within CP.