httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Montague <>
Subject Re: [users@httpd] Add a Alias
Date Wed, 05 Oct 2011 00:03:27 GMT
On October 4, 2011 4:32 , Josu Lazkano <> 
> Hello, I am trying to configure a site, I want to add a Alias. This way
> it works well:
> <VirtualHost *:80>
> 	ServerAdmin mymail
> 	ServerName
> But I want to get my web from 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

If you then also add the alias you give above, then http://server/site1 
and will both serve the same content as   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  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

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message