.htpasswd User generator
Enabling password protection
Add this to the .htaccess file of the directory you want to protect:
AuthName "Description, that is sometimes shown to the user"
This will also protect all subdirectories
Make sure the auth_basic module is loaded.
If it is not already, add this line to your Apache configuration (probably
LoadModule auth_basic_module modules/mod_auth_basic.so
Change the path as needed.
This module depends on other modules which are usually present in a default Installation.
See this site
Path of .htpasswd
might need to be changed.
It is relative to whatever directory is set as main directory in the server configuration.
If you are not sure what that path is, just leave the entry "as-is" and load the site.
If the file doesn't exists (Server will generate HTTP 500 error), you can check the
of Apache to find the full path ot tried to look up.
If you don't have access to the error logs,
you can just try your webservers main http directory (the one you are in when calling your website).
If you have access to the server Configuration, you can look for the
If the file does not exists, create it in the directory you want to protect and name it
If you use Windows, you might find yourself unable to create a file without a name and just an extension.
To work around this issue, open the comamnd prompt (
) and type this:
COPY NUL "C:\Path\To\Your\.htaccess"
The quotes are optional if your path doesn't contains spaces.