Closing a site with .htaccess


The .htaccess file performs many different functions. This is an apache configuration file. Consider how to set a password for access to the site using .htaccess. This may be needed at design time or as an additional security tool.

To store the password (or passwords) from the directory, you need to create another file. Usually it is called .htpasswd, but you can call it differently. Put this file must be in the root of the site or above

Sample entry in .htaccess

AuthName "Authentication required"
AuthType Basic
AuthUserFile /home/yourdir/.htpasswd
require user yourlogin

Set the password for yourlogin user in the .htpasswd file

yourlogin: Mk5aMaDxjJch2

The link to generate passwords

blog comments powered by Disqus