36
36
<li><img alt="" src="../images/down.gif" /> <a href="#combinations">Using more than
37
37
one virtual hosting system on the same server</a></li>
38
38
<li><img alt="" src="../images/down.gif" /> <a href="#ipbased">More efficient IP-based virtual hosting</a></li>
39
<li><img alt="" src="../images/down.gif" /> <a href="#oldversion">Using older versions of Apache</a></li>
40
39
<li><img alt="" src="../images/down.gif" /> <a href="#simple.rewrite">Simple dynamic
41
40
virtual hosts using <code>mod_rewrite</code></a></li>
42
41
<li><img alt="" src="../images/down.gif" /> <a href="#homepages.rewrite">A
294
293
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
295
294
<div class="section">
296
<h2><a name="oldversion" id="oldversion">Using older versions of Apache</a></h2>
298
<p>The examples above rely on <code>mod_vhost_alias</code>
299
which appeared after version 1.3.6. If you are using a version
300
of Apache without <code>mod_vhost_alias</code> then you can
301
implement this technique with <code>mod_rewrite</code> as
302
illustrated below, but only for Host:-header-based virtual
305
<p>In addition there are some things to beware of with logging.
306
Apache 1.3.6 is the first version to include the
307
<code>%V</code> log format directive; in versions 1.3.0 - 1.3.3
308
the <code>%v</code> option did what <code>%V</code> does;
309
version 1.3.4 has no equivalent. In all these versions of
310
Apache the <code>UseCanonicalName</code> directive can appear
311
in <code>.htaccess</code> files which means that customers can
312
cause the wrong thing to be logged. Therefore the best thing to
313
do is use the <code>%{Host}i</code> directive which logs the
314
<code>Host:</code> header directly; note that this may include
315
<code>:port</code> on the end which is not the case for
318
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
319
<div class="section">
320
295
<h2><a name="simple.rewrite" id="simple.rewrite">Simple dynamic
321
296
virtual hosts using <code>mod_rewrite</code></a></h2>