The htaccess file is a supplemental configuration file used by Apache to modify the default configuration as it applies to the directory the .htaccess file it in (as well as all the files in that directory). The most common use is in conjunction with the mod_rewrite and security modules of the Apache webserver. Mod_rewrite allows URLs to be rewritten for scenarios such as the following:

  • Shortcuts such as example.com/info to redirect to another page
  • Redirects from old pages to new pages
  • virtual directories (directories which actually appear elsewhere in the file system)

The most common security applications are:

  • Password protection of directories and files

For more information see the mod_rewrite and aaa documentation.

history | show excerpt | excerpt history