SetThings
Drupalit hottest
Drupalit daily
Drupalit weekly
Drupalit monthly
Change Language
.htaccess
Web Design & Development Guide
.htaccess
.htaccess (Hypertext Access) is the default name of Apache's directory-level configuration file. It provides the ability to customize configuration directives defined in the main configuration file. The configuration directives need to be in .htaccess context and the user needs appropriate permissions.
Error documents
Statements such as the following can be used to configure a server to send out customized documents in response to client errors such as "404 Not Found" or server errors such as "503: Service Temporarily Unavailable"
ErrorDocument 404 /error-pages/not-found.html ErrorDocument 503 /error-pages/service-unavailable.html
Directory rules
A .htaccess file controls the directory it is in, plus all subdirectories. However, by placing additional .htaccess files in the subdirectories, this can be overruled.
User permissions
The user permissions for .htaccess are controlled on server level with the AllowOverride directive which is documented in the Apache Server Documentation.
Other uses
Some web developers have modified .htaccess to perform custom tasks server-side before serving content to the browser. Developer Shaun Inman shows it is possible to edit .htaccess to allow for Server Side Constants within CSS.
External links
- Apache Docs Tutorial: .htaccess files
- mod_rewrite Reference
- Ultimate Apache htaccess Guide and Reference
- Extensive htaccess reference including many htaccess tips, tricks, and examples
- Articles and tutorials with examples
- Online .htaccess File Generator
Web Design & Development Guide, made by MultiMedia | Websites for sale
This guide is licensed under the GNU Free Documentation License. It uses material from the Wikipedia.

