I am using cakephp for my new project.I want to secure my site with .htaccess.Here is what i want to achieve.
If someone tries to go to my site url which is,for now http://www.sample.com.User should not get access without giving password or any other security method.How can i achieve this property?? Shall i eloberate this requirement??then please let me know.
Thanks in advance
With .htaccess you may protect the whole directory with password:
AuthType Basic
AuthName "Restricted Files"
AuthBasicProvider file
AuthUserFile /path/to/passwords/file/passwords
Require user myuser
you may create passwords file with the following command:
htpasswd -c /path/to/passwords/file/passwords myuserYou may complete description with good examples in Apache docs.
Original Answer: .htaccess password and forced login