What is an .htaccess file and how do I use them?
An .htaccess file is a file you put into a directory on your CGI server that
allows you to bypass the standard server configuration so you can do things you
ordinarily wouldn't be able to. This file would affect only the directory that
it is placed in, and any subdirectories within that directory. It will not
however, affect directories outside of the directory it's placed in.
NOTE: .htaccess files are not to be used in your normal web space. They
are only to be used in the directories on your CGI server at
cgi.yourdomain.com (where yourdomain.com represents your actual
domain name).
What can I do with an .htaccess file?
You can
password protect a directory,
create your own 404 Error page,
or even
stop people from certain IP addresses
from accessing a certain directory.
Troubleshooting .htaccess file problems:
.htaccess files closer to the root directory will take precedence over the .htaccess files in any of it's subdirectories. For example, /dir1/.htaccess is used first before /dir1/dir2/.htaccess is looked at by the server.
Any file that starts with a dot (.) is considered a hidden file by the server. As a result, some FTP programs do not show hidden files and you won't be able to see your .htaccess file in the directory. Be sure to use an ftp program which allows you to view all files, even hidden files. In terminal-based FTP programs, you can also view hidden files by using the "ls -a" command.
Some directives (information inside the .htaccess file) may not be allowed on the CGI server for security reasons. This can result in your .htaccess file not working as expected.
Be sure you have typed in the text in your .htaccess file correctly. Sometimes a syntax error can cause the .htaccess file not to work correctly or at all.
Be sure you do not use a word processor to create an .htaccess file. You want to save your .htaccess file in the unix text file format. We do have recommendations on which Text Editors you can use.