Common Usage
- Authorization, authentication
- A .htaccess file is often used to specify security restrictions for a directory, hence the filename "access". The .htaccess file is often accompanied by a .htpasswd file which stores valid usernames and their passwords.
- Rewriting URLs
- Servers often use .htaccess to rewrite long, overly comprehensive URLs to shorter and more memorable ones.
- Blocking
- Use allow/deny to block users by IP address or domain. Also, use to block bad bots, rippers and referrers. Often used to restrict access by Search Engine spiders
- SSI
- Enable server-side includes.
- Directory listing
- Control how the server will react when no specific web page is specified.
- Customized error responses
- Changing the page that is shown when a server-side error occurs, for example HTTP 404 Not Found or, to indicate to a search engine that a page has moved, HTTP 301 Moved Permanently.
- MIME types
- Instruct the server how to treat different varying file types.
- Cache Control
- .htaccess files allow a server to control caching by web browsers and proxies to reduce bandwidth usage, server load, and perceived lag.
Read more about this topic: .htaccess
Famous quotes containing the words common and/or usage:
“For the discerning intellect of Man,
When wedded to this goodly universe
In love and holy passion, shall find these
A simple produce of the common day.
MI, long before the blissful hour arrives,
Would chant, in lonely peace, the spousal verse
Of this great consummation”
—William Wordsworth (17701850)
“Pythagoras, Locke, Socratesbut pages
Might be filled up, as vainly as before,
With the sad usage of all sorts of sages,
Who in his life-time, each was deemed a bore!
The loftiest minds outrun their tardy ages.”
—George Gordon Noel Byron (17881824)