Article No. 190
Created: 04:30 AM 12.26.03
Author: HPU Support [Link: support@homepageuniverse.com]
Original URL: https://my.homepageuniverse.com/support/knowledgebase/question.php?qstId=190
Open a text editor (such as notepad, not Word or WordPad) and save an empty page as htaccess (an extension of txt will be appended). The file will need to be renamed to .htaccess, but we'll leave that till after it's on the server.
Uploading an htaccess File
An htaccess file should be uploaded in ASCII mode, as it's an ASCII file (Do not use binary). The file will automatically be set to CHMOD 644 or RW-R--R--. This make the file usable by the server, but prevents it from being changed via a browser. The file is still web readable and should left that way.
Background Information
Most commands placed inside of an htaccess file are meant to be place on one line only. If you are using a text editor that uses word-wrap, make sure it is disabled. If it is not disabled, it might throw in a few characters that will annoy Apache, even though it's very forgiving of malformed content in an htaccess file.
Whats Affected
htaccess files affect not only the directory they are placed in, but also all subdirectories. For example, if an htaccess file is placed in your root directory (yoursite.com), it would also affect anything in subdirectories such as:
yoursite.com/subdirectory
yoursite.com/subdirectory/subdirectory
You can override this by placing a separate htaccess file in the subdirectories you don't want to be affected. In short, the nearest htaccess file to the content directory is treated as the htaccess file. If the nearest htaccess file is the global htaccess (located in your root folder), than it affects every single directory in your entire site.
Note: Before you start placing htaccess files everywhere, read through the tutorials here first. This will relieve you from hours of stress, caused by creating infinite loop of redirects or errors, by placing something weird in the htaccess file.