Htpasswd Generator
Create secure .htpasswd files for Apache authentication.
About .htpasswd Authentication
The .htpasswd file is used to store usernames and passwords for basic authentication on Apache HTTP Server. It provides a simple but effective way to protect directories, files, or entire websites from unauthorized access.
MD5 (APR1) Algorithm
This is the default and most compatible algorithm for Apache servers. It uses a custom MD5-based hash (APR1) with a random salt for enhanced security.
SHA-1 Algorithm
Uses the SHA-1 hash algorithm. While still supported, MD5 (APR1) is generally preferred for Apache basic authentication.
How to Implement .htpasswd
- Generate your username and password hash using the tool above.
- Create a file named
.htpasswdin a non-public directory on your server. - Paste the generated line (e.g.,
user:$apr1$random$hash) into that file. - Configure your
.htaccessor Apache config to point to this file usingAuthUserFile.