httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Montague <m...@catseye.org>
Subject Re: [users@httpd] Add a Alias
Date Wed, 05 Oct 2011 00:03:27 GMT
On October 4, 2011 4:32 , Josu Lazkano <josu.lazkano@barcelonamedia.org> 
wrote:
> Hello, I am trying to configure a site, I want to add a Alias. This way
> it works well:
>
> <VirtualHost *:80>
> 	ServerAdmin mymail
> 	ServerName site1.mydomain.com
[...]
> But I want to get my web from http://site1.domain.com and
> http://server/site1, so I add this line:
>
>         Alias /site1 /usr/share/site1
>
> But it doesn't work, how could I do that?

You could add the directive

ServerAlias server

so that your name-based virtual host will respond to requests for 
http://server/ and serve the same content for that URL as for 
http://site1.domain.com/

If you then also add the alias you give above, then http://server/site1 
and http://site1.domain.com/site1 will both serve the same content as 
http://site1.domain.com/   Note the overlap here.

If this is not what you want -- if you want the two sites to not overlap 
at all -- then you'd have to use multiple virtual hosts (without the 
ServerAlias directive) to serve http://server/ and 
http://site1.domain.com  You would give the virtual host for 
http://server/ a different document root (something other than 
/usr/share/site1) and then use the Alias directive you give above to map 
the content in /usr/share/site1 to http://server/site1

--
   Mark Montague
   mark@catseye.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message