.htaccess Authentication File Generator

The .htaccess authentifiction file generator creates .htaccess files for Apache server configuration. The .htaccess file allows you to define rules in your folder directory. They can be used to protect a directory with password protection, or to change the name or extension of the index page, or to customize error pages, redirect or forward visitors.

The .htaccess file is placed in the directory in which it must execute the coded commands.
The .htaccess file protects and executes the allowable permissions of the directory that contains the .htaccess file and all of its sub-directories within it.
You can have more than one .htaccess file. For example, you may want an .htaccess file for your root web that just monitors for error pages, but have a sub-folder with it's own .htaccess file for securing a 'members area' that needs password protection.

This DIY section provides you with the most common needed tools to quickly and easily generate .htaccess files, or to add/edit codes to a pre-existing .htaccess file.

Protect access to a directory with a password.

You must first create the file containing passwords for each user with this .htpasswd file generator.
Note that once the authentication is complete, the pages are transferred and can be intercepted with a sniffer. Even if the transmission of the password is encrypted, an experienced hacker can still decrypt the file and gain access to the protected area. For truly secure protection, we encourage you to use SSL / TLS certificates, which truly encrypts your pages.

Path on the server to the file containing passwords:
Title Message :

Protect access to a file with Password Protection.

Again, we need to create passwords for each user with this .htpasswd file generator.

Path on the server to the file containing passwords :
Title Message :

List of file protection:
(names separated by spaces, with wildcards)

Define custom error pages.

Client-side errors
400Bad Syntax
401Unauthorized access (user not correctly identified)
402Not Used (Payment Granted)
403Access denied
404Page not found
Server side errors
500Internal Error
501Not Implemented
503Gateway Timeout

You would add this generated code to your .htaccess file, or create an .htaccess file and place the file inside the main directory or folder.

Error page 400 :
Error page 401 :
Error page 402 :
Error page 403 :
Error page 404 :
Error page 500 :
Error page 501 :
Error page 502 :
Error page 503 :

Change the default index file.

The index file is the file that is displayed when no file name is defined in a URL path (eg; http://www.domain.com/folder).
This prevents the browser from listing all files contained in the directory (for privacy reasons).
Normally, it is index.html or index.htm or index.php .
You can name your default page any file name you like.

List of index file in the search order:
(names separated by spaces)

Add a MIME type

This command is used to define the behavior of the browser face for certain file extensions.
For example, by combining the extension .doc the type application/octet-stream ( type normal executable binary files),
the browser is forced to download files .doc instead of running Word to display. By combining the .psd type image/x-photoshop, is forced to launch Photoshop (if installed) to view files with .psd .

Select MIME Type:
File Extensions:
(list of extensions separated by spaces)

To add a type that is not listed in our list, simply use a predefined type that is listed and alter to your needs.