Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>What you need is called <a href="http://httpd.apache.org/docs/2.2/vhosts/examples.html" rel="nofollow noreferrer">VirtualHost</a> to make www.example1.com and www.exaplme2.com point each to a different folder in your filesystem. </p> <p>If you additionally wish to have a different path in the URI for serving the main content you have various alternatives:</p> <ol> <li><p>Physically create the folder and do no further changes</p></li> <li><p>Physically create a link (named gallery pointing to the main virtualhost root folder) to the folder and use the <a href="http://httpd.apache.org/docs/2.2/mod/core.html#options" rel="nofollow noreferrer">FollowSymLinks</a> option for the VirtualHost</p></li> <li><p>Use an <a href="http://httpd.apache.org/docs/2.2/mod/mod_alias.html" rel="nofollow noreferrer">Alias</a> directive in the VirtualHost</p> <pre><code>Alias /gallery / </code></pre></li> <li><p>Use mod_rewrite</p> <pre><code>RewriteRule /gallery/(.*) /$1 [QSA] </code></pre></li> </ol> <p>The simplest (CodeIgniter permitting) would be the option 1 or 2.</p> <p>Snippet from the VirtualHost documentation:</p> <pre> Running several name-based web sites on a single IP address. Your server has a single IP address, and multiple aliases (CNAMES) point to this machine in DNS. You want to run a web server for www.example.com and www.example.org on this machine. Note Creating virtual host configurations on your Apache server does not magically cause DNS entries to be created for those host names. You must have the names in DNS, resolving to your IP address, or nobody else will be able to see your web site. You can put entries in your hosts file for local testing, but that will work only from the machine with those hosts entries. Server configuration # Ensure that Apache listens on port 80 Listen 80 # Listen for virtual host requests on all IP addresses NameVirtualHost *:80 &lt;VirtualHost *:80> DocumentRoot /www/example1 ServerName www.example.com # Other directives here &lt;/VirtualHost> &lt;VirtualHost *:80> DocumentRoot /www/example2 ServerName www.example.org # Other directives here &lt;/VirtualHost> The asterisks match all addresses, so the main server serves no requests. Due to the fact that www.example.com is first in the configuration file, it has the highest priority and can be seen as the default or primary server. That means that if a request is received that does not match one of the specified ServerName directives, it will be served by this first VirtualHost. </pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload