sections.xml revision 860b4efe27e7c1c9a2bf5c872b29c90f76849b51
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<!-- $LastChangedRevision$ -->
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs Licensed to the Apache Software Foundation (ASF) under one or more
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs contributor license agreements. See the NOTICE file distributed with
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs this work for additional information regarding copyright ownership.
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs The ASF licenses this file to You under the Apache License, Version 2.0
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs (the "License"); you may not use this file except in compliance with
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs the License. You may obtain a copy of the License at
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs Unless required by applicable law or agreed to in writing, software
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs distributed under the License is distributed on an "AS IS" BASIS,
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs See the License for the specific language governing permissions and
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs limitations under the License.
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobshref="configuring.html">configuration files</a> may apply to the
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsentire server, or they may be restricted to apply only to particular
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsdirectories, files, hosts, or URLs. This document describes how to
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsuse configuration section containers or <code>.htaccess</code> files
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsto change the scope of other configuration directives.</p>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<section id="types"><title>Types of Configuration Section Containers</title>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<modulelist>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs</modulelist>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<directivelist>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<directive type="section" module="core">Directory</directive>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<directive type="section" module="core">DirectoryMatch</directive>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<directive type="section" module="core">Files</directive>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<directive type="section" module="core">FilesMatch</directive>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<directive type="section" module="core">If</directive>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<directive type="section" module="core">IfDefine</directive>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<directive type="section" module="core">IfModule</directive>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<directive type="section" module="mod_version">IfVersion</directive>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<directive type="section" module="core">Location</directive>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<directive type="section" module="core">LocationMatch</directive>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<directive type="section" module="mod_proxy">Proxy</directive>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<directive type="section" module="mod_proxy">ProxyMatch</directive>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<directive type="section" module="core">VirtualHost</directive>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs</directivelist>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<p>There are two basic types of containers. Most containers are
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsevaluated for each request. The enclosed directives are applied only
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsfor those requests that match the containers. The <directive
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobstype="section" module="core">IfDefine</directive>, <directive
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobstype="section" module="core">IfModule</directive>, and
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<directive type="section" module="mod_version">IfVersion</directive>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobscontainers, on the other hand, are evaluated only at server startup
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsand restart. If their conditions are true at startup, then the
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsenclosed directives will apply to all requests. If the conditions are
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsnot true, the enclosed directives will be ignored.</p>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<p>The <directive type="section" module="core">IfDefine</directive> directive
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsencloses directives that will only be applied if an appropriate
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsparameter is defined on the <program>httpd</program> command line. For example,
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobswith the following configuration, all requests will be redirected
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsto another site only if the server is started using
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<IfDefine ClosedForNow><br />
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs</IfDefine>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<p>The <directive type="section" module="core">IfModule</directive>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsdirective is very similar, except it encloses directives that will
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsonly be applied if a particular module is available in the server.
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsThe module must either be statically compiled in the server, or it
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsmust be dynamically compiled and its <directive
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsmodule="mod_so">LoadModule</directive> line must be earlier in the
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsconfiguration file. This directive should only be used if you need
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsyour configuration file to work whether or not certain modules are
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsinstalled. It should not be used to enclose directives that you want
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsto work all the time, because it can suppress useful error messages
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsabout missing modules.</p>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsmodule="mod_mime_magic">MimeMagicFiles</directive> directive will be
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsapplied only if <module>mod_mime_magic</module> is available.</p>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs</IfModule>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs<p>The <directive type="section" module="mod_version">IfVersion</directive>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsdirective is very similar to <directive type="section"
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsmodule="core">IfDefine</directive> and <directive type="section"
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsmodule="core">IfModule</directive>, except it encloses directives that will
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsonly be applied if a particular version of the server is executing. This
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsmodule is designed for the use in test suites and large networks which have to
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsdeal with different httpd versions and different configurations.</p>
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs <IfVersion >= 2.1><br />
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs # this happens only in versions greater or<br />