All Tools
.htaccess Authentication Generator
Generate .htaccess and .htpasswd files for basic HTTP authentication on Apache servers.
.htaccess auth is only as strong as the password stored in .htpasswd. Before you paste anything in, roll a fresh secret with our Password Generator — length 20+ with symbols is the safe default for a directory gate that ends up in a version-controlled config file.
The server path to the directory, e.g. /home/usr/websites. If unsure, save <?php echo dirname(__FILE__); ?> as a .php file in the directory and visit it in your browser.
One per line: username password