Книга: Fedora™ Unleashed, 2008 edition

Using .htaccess Configuration Files

Using .htaccess Configuration Files

Apache also supports special configuration files, known as .htaccess files. Almost any directive that appears in httpd.conf can appear in an .htaccess file. This file, specified in the AccessFileName directive in httpd.conf (or srm.conf prior to version 1.3.4) sets configurations on a per-directory (usually in a user directory) basis. As the system administrator, you can specify both the name of this file and which of the server configurations can be overridden by the contents of this file. This is especially useful for sites in which there are multiple content providers and you want to control what these people can do with their spaces.

To limit which server configurations the .htaccess files can override, use the AllowOverride directive. AllowOverride can be set globally or per directory. For example, in your httpd.conf file, you could use the following:

# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, it's best to configure the "default" to be a very restrictive set of
# permissions.
#
<Directory />
 Options FollowSymLinks
 AllowOverride None
</Directory>

Оглавление книги


Генерация: 1.261. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз