expressions</a> can also be used, with the addition of the
<code>~</code> character. For example:</p>
- <pre class="prettyprint lang-config"><Directory ~ "^/www/.*/[0-9]{3}"></pre>
+ <pre class="prettyprint lang-config">
+<Directory ~ "^/www/.*/[0-9]{3}">
+
+</Directory>
+</pre>
<p>would match directories in <code>/www/</code> that consisted of
However, it takes as an argument a
<a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>. For example:</p>
- <pre class="prettyprint lang-config"><DirectoryMatch "^/www/(.+/)?[0-9]{3}"></pre>
+ <pre class="prettyprint lang-config">
+<DirectoryMatch "^/www/(.+/)?[0-9]{3}">
+ # ...
+</DirectoryMatch>
+</pre>
<p>would match directories in <code>/www/</code> that consisted of three
can also be used, with the addition of the
<code>~</code> character. For example:</p>
- <pre class="prettyprint lang-config"><Files ~ "\.(gif|jpe?g|png)$"></pre>
+ <pre class="prettyprint lang-config">
+<Files ~ "\.(gif|jpe?g|png)$">
+ #...
+</Files>
+</pre>
<p>would match most common Internet graphics formats. <code class="directive"><a href="#filesmatch"><FilesMatch></a></code> is preferred,
</p>
<pre class="prettyprint lang-config">
<Location /private1>
-# ...
+ # ...
+</Location>
</pre>
<p>
</p>
<pre class="prettyprint lang-config">
<Location /private2<em>/</em>>
-# ...
+ # ...
+</Location>
</pre>
can also be used, with the addition of the <code>~</code>
character. For example:</p>
- <pre class="prettyprint lang-config"><Location ~ "/(extra|special)/data"></pre>
+ <pre class="prettyprint lang-config">
+<Location ~ "/(extra|special)/data">
+ #...
+</Location>
+</pre>
<p>would match URLs that contained the substring <code>/extra/data</code>
it takes a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>
as an argument instead of a simple string. For example:</p>
- <pre class="prettyprint lang-config"><LocationMatch "/(extra|special)/data"></pre>
+ <pre class="prettyprint lang-config">
+<LocationMatch "/(extra|special)/data">
+ # ...
+</LocationMatch>
+</pre>
<p>would match URLs that contained the substring <code>/extra/data</code>