proteger solo una carpeta en apache con contraseña

The question is that I want to protect only one folder "admin", I was using this in my .htaccess placed in /home/my_home/public_html

AuthName "message"
AuthType Basic
AuthUserFile /home/my_home/.htpasswd
require valid-user

but this protect all my site whilst I want to protect actually /home/my_home/public_html/admin. IN my error log I see:

/home/myhome/public_html/admin/.htaccess: <Directory not allowed here

preguntado el 23 de abril de 13 a las 13:04

tratan este -

put the file in /home/my_home/public_html/admin not /home/my_home/public_html -

didnt work.....protect the whole site. I also moved the file to the other file, But no result -

1 Respuestas

You have to put the .htaccess file into your admin folder.

The configuration directives found in a .htaccess file are applied to the directory in which the .htaccess file is found, and to all subdirectories thereof. see Documentación de apache

Respondido 23 Abr '13, 13:04

yes, I knew that, but is not working.I have my .htaccess with those directives inside my admin folder...but nothing - Francis

Please ensure, that you've deleted the .htaccess file in your /home/my_home/public_html folder and that the .htaccess file in your admin folder is named correctly. Often people forget the dot in front of the filename. Furthermore a browser restart or page reload could help (strg + f5 on firefox) - Alexxus

I have to delete my htacces in public_html?? - Francis

Yes, you have to delete the .htacess file inside your public_html folder. The only .htacess file you should have is the one in the admin folder. - Alexxus

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.