Introduction to .htaccess files


Your Web directory and its subdirectories can contain per-directory configuration files called .htaccess files. Whenever our Web server receives a request for a file, it first looks for a file called .htaccess in that directory and its parent directories. If one is present the server considers the configuration directives within it before responding to the request. A .htaccess file works like this:

A .htaccess file must be a plain text file and contain no special formatting elements.
Use a text editor to create your .htaccess file.
If you create it with a word processor, be sure to save it as plain text.
A .htaccess file contains a list of configuration directives and nothing else.
A .htaccess file must be saved in the top directory to which you want it to apply.
The directives apply to that directory and its subdirectories.
If a subdirectory contains a .htaccess file, it overrides the .htaccess files of its parent directories.
If a .htaccess file contains any other information, it must be commented out in order to prevent errors.
*For those of you who want to use a different extension for your index page put the following in:
DirectoryIndex index.html index.htm index.shtml default.htm default.html Default.htm Default.html index.cfm
put in the htdocs directory.


Back to the Index

© 1997-2001 Internet Quality Services Corporation. All rights reserved.