mod_version.xml revision 7ccd2526c2d2128d7b6c4ed090e3982d7da8c651
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd Copyright 2004 The Apache Software Foundation
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd Licensed under the Apache License, Version 2.0 (the "License");
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd you may not use this file except in compliance with the License.
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd 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<compatibility>Available in version 2.1 and later</compatibility>
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>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <IfVersion 2.1.0><br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd # current httpd version is exactly 2.1.0<br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </IfVersion><br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <IfVersion >= 2.2><br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd # use really new features :-)<br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </IfVersion>
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
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd configuration directives which are executed only if the httpd version
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>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <IfVersion >= 2.1><br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd # this happens only in versions greater or<br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd # equal 2.1.0.<br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </IfVersion>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </example>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <p>Besides the numerical comparison it is possible to match a regular
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd expression against the httpd version. There are two ways to write it:</p>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <IfVersion = /^2.1.[01234]$/><br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd # e.g. workaround for buggy versions
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </IfVersion>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </example>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <p>In order to reverse the meaning, all operators can be preceded by an
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <IfVersion !~ ^2.1.[01234]$><br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd # not for those versions<br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </IfVersion>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </example>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <p>If the operator is omitted, it is assumed to be <code>=</code>.</p>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd</directivesynopsis>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd</modulesynopsis>