ABHIONLINUX
Site useful for linux administration and web hosting

2009/07/30

Htaccess

.htaccess files (or "distributed configuration files") provide a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory, and the directives apply to that directory, and all subdirectories thereof.

If you want to call a file using htaccess
Accessfilename .config

AllowOverride is set to allow the use of .htaccess files

It is completely equivalent to put a .htaccess file in a directory /www/htdocs/example containing a directive, and to put that same directive in a Directory section in your main server configuration:

The use of .htaccess files can be disabled completely by setting the AllowOverride directive to "none" AllowOverride None

In the directory /www/htdocs/example1 we have a .htaccess file containing the following:
Options +ExecCGI

(Note: you must have "AllowOverride Options" in effect to permit the use of the "Options" directive in .htaccess files.)

In the directory /www/htdocs/example1/example2 we have a .htaccess file containing:

Options Includes

Authentication

You must have "AllowOverride AuthConfig" in effect for these directives to be honored.

.htaccess file contents:

AuthType Basic
AuthName "Password Required"
AuthUserFile /www/passwords/password.file
AuthGroupFile /www/passwords/group.file
Require Group admins


Server side includes

Options +Includes
AddType text/html shtml
AddHandler server-parsed shtml


Options +ExecCGI
AddHandler cgi-script cgi pl

If you wish to have all files in the given directory be considered to be CGI program
Options +ExecCGI
SetHandler cgi-script


No comments:

Post a Comment