7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd<!-- $LastChangedRevision$ -->
031b91a62d25106ae69d4693475c79618dd5e884fielding Licensed to the Apache Software Foundation (ASF) under one or more
031b91a62d25106ae69d4693475c79618dd5e884fielding contributor license agreements. See the NOTICE file distributed with
031b91a62d25106ae69d4693475c79618dd5e884fielding this work for additional information regarding copyright ownership.
031b91a62d25106ae69d4693475c79618dd5e884fielding The ASF licenses this file to You under the Apache License, Version 2.0
031b91a62d25106ae69d4693475c79618dd5e884fielding (the "License"); you may not use this file except in compliance with
031b91a62d25106ae69d4693475c79618dd5e884fielding the License. You may obtain a copy of the License at
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd Unless required by applicable law or agreed to in writing, software
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd distributed under the License is distributed on an "AS IS" BASIS,
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd See the License for the specific language governing permissions and
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd limitations under the License.
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<description>Version dependent configuration</description>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <p>This module is designed for the use in test suites and large
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd networks which have to deal with different httpd versions and
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd different configurations. It provides a new container -- <directive
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd type="section" module="mod_version">IfVersion</directive>, which
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd allows a flexible version checking including numeric comparisons and
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd regular expressions.</p>
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh<IfVersion 2.4.2>
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh # current httpd version is exactly 2.4.2
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh</IfVersion>
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh<IfVersion >= 2.5>
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh # use really new features :-)
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh</IfVersion>
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh </highlight>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </example>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<description>contains version dependent configuration</description>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<syntax><IfVersion [[!]<var>operator</var>] <var>version</var>> ...
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd</IfVersion></syntax>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<contextlist><context>server config</context><context>virtual host</context>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<context>directory</context><context>.htaccess</context></contextlist>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <p>The <directive type="section">IfVersion</directive> section encloses
a1ef40892ffa2b44fc249423c5b6c42a74a84c68nd configuration directives which are executed only if the
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd matches the desired criteria. For normal (numeric) comparisons the
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <code><var>major</var>[.<var>minor</var>[.<var>patch</var>]]</code>, e.g.
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <code>2.1.0</code> or <code>2.2</code>. <var>minor</var> and
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <var>patch</var> are optional. If these numbers are omitted, they are
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd assumed to be zero. The following numerical <var>operator</var>s are
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd possible:</p>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <tr><th><var>operator</var></th><th>description</th></tr>
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh<IfVersion >= 2.3>
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh # this happens only in versions greater or
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh # equal 2.3.0.
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh</IfVersion>
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh </highlight>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </example>
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <p>Besides the numerical comparison it is possible to match a
030108b1816bcda3d925df65357feabdce83bc94slive against the httpd version. There are two ways to write it:</p>
1235345dc5fd04766bcf6f9c18d14638eda2eea1nd <tr><th><var>operator</var></th><th>description</th></tr>
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh<IfVersion = /^2.4.[01234]$/>
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh # e.g. workaround for buggy versions
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh</IfVersion>
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh </highlight>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </example>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <p>In order to reverse the meaning, all operators can be preceded by an
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh<IfVersion !~ ^2.4.[01234]$>
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh # not for those versions
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh</IfVersion>
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh </highlight>
1235345dc5fd04766bcf6f9c18d14638eda2eea1nd <p>If the <var>operator</var> is omitted, it is assumed to be
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd</directivesynopsis>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd</modulesynopsis>