.htaccess Wiki resources & .htaccess information at HealthHaven.com
advertise
toolbar
services
publishers
database
membership
Dr. Paul

Search  for    ?
web dir image video media news gallery wiki shop 
about
HealthBot
stats
live show
health store
shirts
JOIN/LOGIN
.htaccess:

In several web servers (most commonly Apache), .htaccess (hypertext access) is the default name of directory-level configuration files. A .htaccess file is placed in a particular directory, and the directives in the .htaccess file apply to that directory, and all subdirectories thereof. It provides the ability to customize configuration for requests to the particular directory. The file name starts with a dot because dot-files are by convention hidden files on Unix-like operating systems. A subset of Apache's .htaccess syntax is also supported by other web servers, such as Sun Java System Web Server and Zeus Web Server.

Contents

[edit] Common usage

Authorization, authentication
.htaccess files are often used to specify the security restrictions for the particular directory, hence the filename "access." The .htaccess file is often accompanied by an .htpasswd file which stores valid usernames and their passwords.
Customized error responses
Changing the page that is shown when a server-side error occurs, for example HTTP 404 Not Found.
Rewriting URLs
Servers often use .htaccess to rewrite "ugly" URLs to shorter and prettier ones.
Cache Control
.htaccess files allow a server to control User agent caching used by web browsers to reduce bandwidth usage, server load, and perceived lag.

[edit] When .htaccess files should be used

For servers with multiple users, as is common in shared web hosting plans, it is often desirable to allow individual users the ability to alter their site configuration. In general, .htaccess files should be used by users who do not have access to the main server configuration files.[1]

[edit] When .htaccess files should not be used

To control Apache, using the main server configuration file httpd.conf[2] is preferred for security and performance reasons:[3]

Performance loss 
For each HTTP request there are additional file-system accesses for every parent directory when using .htaccess.
Security 
Allowing individual users to modify the configuration of a server can cause security concerns if not set up properly.

[edit] See also

[edit] References

[edit] External links



Search  for    ?
web dir image video media news gallery wiki shop 


↑ top of page ↑