When you come to upload your .htaccess files, you should be aware
that it makes a difference as to where you put them. A single .htaccess
file in the root directory will have an effect on the entire site, but it can be
over-ridden by putting a different .htaccess file in your sub directories.
The server will look for a .htaccess file in the same directory as
the error first, if it can't find one it will move one directory back until it
finds one. Of course, if it doesn't find one then it will just use either the
server's or browser's default error page (depending on server setup).
It is recommended that you upload your .htaccess file in
ASCII rather than binary format, to ensure that information in the file is not corrupted. Be aware that most FTP programs do not show hidden files by default, so if you upload a correctly named file then you could be forgiven for thinking that you hadn't uploaded it. Similarly, if you need to rename it on the server, the file will appear to disappear from view even when it is still there. If you want more information on how to view and work with these files, please see my advanced ftp tutorial, which makes use of WS_FTP LE.
Although you probably will not need to change the actual contents of your .htaccess file very often, the fact that it is a hidden file on the server does not make the job of maintenance any easier. I would recommend that you keep a copy of any .htaccess files along with the local copy of your site this way you can make changes offline and upload it when you are ready to apply the changes (you do have a local copy of your site, don't you?).
The main advantage of keeping a local copy is that you can easily see the current settings (assuming that you only change the file when you add or change any settings). This is useful because you do not run the risk of removing any settings that you might have forgotten that you put in your .htaccess file.
If you are unfamiliar with Apache and its configuration files, then you might find the idea of tweaking your server via .htaccess a daunting prospect. While the contents of the file can sometimes be difficult to interpret, there are a series of rules that you can follow when configuring the server in this way.
So why not give it a go? Have fun experiementing with some of the more advanced features of your Apache server!
Originally Published: Tue 23rd Dec, 2003
The author, Rosemarie Wise, is a self proclaimed "web enthusiast" who set up her site,
Web Site Owner to share her experiences
of being a site owner.