github.com/krum110487/go-htaccess@v0.0.0-20240316004156-60641c8e7598/tests/data/apache_2_2_34/manual/mod/mod_version.html.en (about)

     1  <?xml version="1.0" encoding="ISO-8859-1"?>
     2  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
     3  <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
     4  <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
     5  <!--
     6          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
     7                This file is generated from xml source: DO NOT EDIT
     8          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
     9        -->
    10  <title>mod_version - Apache HTTP Server Version 2.2</title>
    11  <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
    12  <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
    13  <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" />
    14  <script src="../style/scripts/prettify.min.js" type="text/javascript">
    15  </script>
    16  
    17  <link href="../images/favicon.ico" rel="shortcut icon" /><link href="http://httpd.apache.org/docs/current/mod/mod_version.html" rel="canonical" /></head>
    18  <body>
    19  <div id="page-header">
    20  <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
    21  <p class="apache">Apache HTTP Server Version 2.2</p>
    22  <img alt="" src="../images/feather.gif" /></div>
    23  <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
    24  <div id="path">
    25  <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.2</a> &gt; <a href="./">Modules</a></div>
    26  <div id="page-content">
    27  <div class="retired"><h4>Please note</h4>
    28              <p> This document refers to a legacy release (<strong>2.2</strong>) of Apache httpd. The active release (<strong>2.4</strong>) is documented <a href="http://httpd.apache.org/docs/current">here</a>. If you have not already upgraded, please follow <a href="http://httpd.apache.org/docs/current/upgrading.html">this link</a> for more information.</p>
    29          <p>You may follow <a href="http://httpd.apache.org/docs/current/mod/mod_version.html">this link</a> to go to the current version of this document.</p></div><div id="preamble"><h1>Apache Module mod_version</h1>
    30  <div class="toplang">
    31  <p><span>Available Languages: </span><a href="../en/mod/mod_version.html" title="English">&nbsp;en&nbsp;</a> |
    32  <a href="../ja/mod/mod_version.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
    33  <a href="../ko/mod/mod_version.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
    34  </div>
    35  <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Version dependent configuration</td></tr>
    36  <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
    37  <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>version_module</td></tr>
    38  <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_version.c</td></tr>
    39  <tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.56 and later</td></tr></table>
    40  <h3>Summary</h3>
    41  
    42      <p>This module is designed for the use in test suites and large
    43      networks which have to deal with different httpd versions and
    44      different configurations. It provides a new container -- <code class="directive"><a href="#ifversion">&lt;IfVersion&gt;</a></code>, which
    45      allows a flexible version checking including numeric comparisons and
    46      regular expressions.</p>
    47  
    48      <div class="example"><h3>Examples</h3><p><code>
    49        &lt;IfVersion 2.1.0&gt;<br />
    50        <span class="indent">
    51          # current httpd version is exactly 2.1.0<br />
    52        </span>
    53        &lt;/IfVersion&gt;<br />
    54        <br />
    55        &lt;IfVersion &gt;= 2.2&gt;<br />
    56        <span class="indent">
    57          # use really new features :-)<br />
    58        </span>
    59        &lt;/IfVersion&gt;
    60      </code></p></div>
    61  
    62      <p>See below for further possibilities.</p>
    63  </div>
    64  <div id="quickview"><h3 class="directives">Directives</h3>
    65  <ul id="toc">
    66  <li><img alt="" src="../images/down.gif" /> <a href="#ifversion">&lt;IfVersion&gt;</a></li>
    67  </ul>
    68  <ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
    69  
    70  <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
    71  <div class="directive-section"><h2><a name="IfVersion" id="IfVersion">&lt;IfVersion&gt;</a> <a name="ifversion" id="ifversion">Directive</a></h2>
    72  <table class="directive">
    73  <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>contains version dependent configuration</td></tr>
    74  <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;IfVersion [[!]<var>operator</var>] <var>version</var>&gt; ...
    75  &lt;/IfVersion&gt;</code></td></tr>
    76  <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
    77  <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
    78  <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
    79  <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_version</td></tr>
    80  </table>
    81      <p>The <code class="directive">&lt;IfVersion&gt;</code> section encloses
    82      configuration directives which are executed only if the
    83      <code class="program"><a href="../programs/httpd.html">httpd</a></code> version
    84      matches the desired criteria. For normal (numeric) comparisons the
    85      <var>version</var> argument has the format
    86      <code><var>major</var>[.<var>minor</var>[.<var>patch</var>]]</code>, e.g.
    87      <code>2.1.0</code> or <code>2.2</code>. <var>minor</var> and
    88      <var>patch</var> are optional. If these numbers are omitted, they are
    89      assumed to be zero. The following numerical <var>operator</var>s are
    90      possible:</p>
    91  
    92      <table class="bordered"><tr class="header"><th><var>operator</var></th><th>description</th></tr>
    93  <tr><td><code>=</code> or <code>==</code></td>
    94          <td>httpd version is equal</td></tr>
    95  <tr class="odd"><td><code>&gt;</code></td>
    96          <td>httpd version is greater than</td></tr>
    97  <tr><td><code>&gt;=</code></td>
    98          <td>httpd version is greater or equal</td></tr>
    99  <tr class="odd"><td><code>&lt;</code></td>
   100          <td>httpd version is less than</td></tr>
   101  <tr><td><code>&lt;=</code></td>
   102          <td>httpd version is less or equal</td></tr>
   103  </table>
   104  
   105      <div class="example"><h3>Example</h3><p><code>
   106        &lt;IfVersion &gt;= 2.1&gt;<br />
   107        <span class="indent">
   108          # this happens only in versions greater or<br />
   109          # equal 2.1.0.<br />
   110        </span>
   111        &lt;/IfVersion&gt;
   112      </code></p></div>
   113  
   114      <p>Besides the numerical comparison it is possible to match a 
   115      <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a> 
   116      against the httpd version. There are two ways to write it:</p>
   117  
   118      <table class="bordered"><tr class="header"><th><var>operator</var></th><th>description</th></tr>
   119  <tr><td><code>=</code> or <code>==</code></td>
   120          <td><var>version</var> has the form
   121              <code>/<var>regex</var>/</code></td></tr>
   122  <tr class="odd"><td><code>~</code></td>
   123          <td><var>version</var> has the form
   124              <code><var>regex</var></code></td></tr>
   125  </table>
   126  
   127      <div class="example"><h3>Example</h3><p><code>
   128        &lt;IfVersion = /^2.1.[01234]$/&gt;<br />
   129        <span class="indent">
   130          # e.g. workaround for buggy versions
   131        </span>
   132        &lt;/IfVersion&gt;
   133      </code></p></div>
   134  
   135      <p>In order to reverse the meaning, all operators can be preceded by an
   136      exclamation mark (<code>!</code>):</p>
   137  
   138      <div class="example"><p><code>
   139        &lt;IfVersion !~ ^2.1.[01234]$&gt;<br />
   140        <span class="indent">
   141          # not for those versions<br />
   142        </span>
   143        &lt;/IfVersion&gt;
   144      </code></p></div>
   145  
   146      <p>If the <var>operator</var> is omitted, it is assumed to be
   147      <code>=</code>.</p>
   148  
   149  </div>
   150  </div>
   151  <div class="bottomlang">
   152  <p><span>Available Languages: </span><a href="../en/mod/mod_version.html" title="English">&nbsp;en&nbsp;</a> |
   153  <a href="../ja/mod/mod_version.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
   154  <a href="../ko/mod/mod_version.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
   155  </div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
   156  <script type="text/javascript"><!--//--><![CDATA[//><!--
   157  var comments_shortname = 'httpd';
   158  var comments_identifier = 'http://httpd.apache.org/docs/2.2/mod/mod_version.html';
   159  (function(w, d) {
   160      if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
   161          d.write('<div id="comments_thread"><\/div>');
   162          var s = d.createElement('script');
   163          s.type = 'text/javascript';
   164          s.async = true;
   165          s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
   166          (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
   167      }
   168      else { 
   169          d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
   170      }
   171  })(window, document);
   172  //--><!]]></script></div><div id="footer">
   173  <p class="apache">Copyright 2017 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
   174  <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
   175  if (typeof(prettyPrint) !== 'undefined') {
   176      prettyPrint();
   177  }
   178  //--><!]]></script>
   179  </body></html>