The .htaccess File

Your Web site uses the Apache Web server, which may be configured via a text file called .htaccess (note the period in front of the name). The .htaccess file is placed in any directory on your Web site and contains special directives to the Web server that affect its behavior.

When the Apache Web server is getting ready to serve your Web site's pages, it will first read an .htaccess file, if one exists, and take whatever action is specified in the file:

To add an .htaccess file to a folder:

  1. Create a file named .htaccess in a plain text editor, such as Windows Notepad or the Control Center's File Manager tool.

  2. Add directives to the file, one directive per line.

  3. Upload the file to a directory on your site.

The directives in the .htaccess file will affect all files and folders (and their contents) within that folder. If you place an .htaccess file in a subfolder, it will supersede the one above it.

Common .htaccess Directives

The File Manager has a list of shortcuts you can use to quickly add common security-related directives to an .htaccess file. In File Manager, when editing an .htaccess file you will see a menu above the text entry box. Select an action from the menu and click the Add button, and the directive will appear as a line in the text entry box. The current directives include:

 

Learn more about .htaccess files:

Note: The File Manager has a tool to password protect folders. This feature will modify the .htaccess file in the folder you want to add protection to. If you modify the .htaccess file in a password-protected folder, be sure not to modify the additions made by File Manager, or your password protection may not work for that folder.