A .htaccess file is a directory-level configuration file used to override a subset of the web server's global configuration.

A .htaccess file is a directory-level configuration file used to override a subset of the web server's global configuration. Support for the .htaccess file is most commonly found in the Apache web server, but other web servers such as Litespeed and Sun Java System Web Server also provide support.

The file is usually placed within the root directory of the website, but can also be placed within sub-directories to provide an even finer grained configuration.

Common uses of .htaccess files include: Authorization, Authentication, Rewriting URLs, Blocking by IP / Domains, Server Side Includes (SSI), MIME Type control, Directory Listing control.