Apache .htaccess File Help For Non Techies
The .htaccess file is a very powerful text control file found on apache servers (note: even if they run on windows) that allows control over various components of the web server.
For example the .htaccess file can be used to:
- Password protect pages/directories
- Block users
- Do redirects
- Change default home page
- Add file extensions
- etc
What exactly you can do with the file is determined by the server administrator, and so just because it is possible to use the .htaccess file to configure, say password
protection, it doesn't mean that you will be able to do it on your hosting package.
Name and structure and Flow
The file name is itself very confusing as there isn't really a name just a file extension. Most files take the form name.extension. However
the .htaccess is just a file extension.
The file itself is a simple text file edited using a text editor like notepad (not word) with a single directive (instruction) per line.
There can be multiple .htaccess files on a website but only one per directory. Instructions in a .htaccess file in a parent directory will affect the sub directory unless
specifically blocked or overwritten by a .htaccess file in the sub directory.
That is to say child directories automatically inherit the .htaccess file directives from the parent directory as the sketch below attempts to show.

Related Articles and Resources:
|