<p><span>Available Languages: </span><a href="../en/vhosts/examples.html" title="English"> en </a> |
<a href="../ko/vhosts/examples.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
</div>
<p>This document attempts to answer the commonly-asked questions about
setting up virtual hosts. These scenarios are those involving multiple
web sites running on a single server, via <a href="name-based.html">name-based</a> or <a href="ip-based.html">IP-based</a> virtual hosts. A document should be
coming soon about running sites on several servers behind a single
proxy server.</p>
</div>
<div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#purename">Running several name-based web
sites on a single IP address.</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#twoips">Name-based hosts on more than one
IP address.</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#intraextra">Serving the same content on
different IP addresses (such as an internal and external
address).</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#port">Running different sites on different
<p>Due to the <code class="directive"><a href="../mod/core.html#serverpath">ServerPath</a></code>
directive a request to the URL
<code>http://www.sub1.domain.tld/sub1/</code> is <em>always</em> served
from the sub1-vhost.<br /> A request to the URL
<code>http://www.sub1.domain.tld/</code> is only
served from the sub1-vhost if the client sent a correct
<code>Host:</code> header. If no <code>Host:</code> header is sent the
client gets the information page from the primary host.<br />
Please note that there is one oddity: A request to
<code>http://www.sub2.domain.tld/sub1/</code> is also served from the
sub1-vhost if the client sent no <code>Host:</code> header.<br />
The <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> directives
are used to make sure that a client which sent a correct
<code>Host:</code> header can use both URL variants, <em>i.e.</em>,
with or without URL prefix.</p>
</div></div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="../en/vhosts/examples.html" title="English"> en </a> |
<a href="../ko/vhosts/examples.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
</div><div id="footer">
<p class="apache">Copyright 1999-2004 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>