[Lula] Multiple Domains - Apache
Cheeto
cheeto at shaolinux.org
Tue Apr 29 08:32:59 EDT 2008
That's because you going to http://domainb.com doesn't match any of your
vhost definition so it defaults to the default vhost which in this
configuration is www.domaina.com. You need to specify ServerAlias for
each vhost.
so for www.domaina.com:
ServerName www.domaina.com
ServerAlias domaina.com
for www.domainb.com:
ServerName www.domainb.com
ServerAlias domainb.com
-Michael Hsu
Deepan wrote:
> Hi All,
> I am serving two domains from the same machine
> using Apache. I want www to be used in both of the
> domains, hence I redirect urls without www to
> appropriate urls with www. I have the following
> configuration in httpd.conf to achieve this.
>
>
>
> NameVirtualHost *:80
>
> <VirtualHost *:80>
> DocumentRoot /var/www/html/domaina/
> ServerName www.domaina.com
> Options +FollowSymLinks
> RewriteEngine On
> RewriteCond %{HTTP_HOST} ^domaina\.com$ [NC]
> RewriteRule ^(.*)$ http://www.domaina.com$1
> [R=301,L]
> </VirtualHost>
>
>
> <VirtualHost *:80>
> DocumentRoot /var/www/html/domainb/
> ServerName www.domainb.com
> Options +FollowSymLinks
> RewriteEngine On
> RewriteCond %{HTTP_HOST} ^domainb\.com$ [NC]
> RewriteRule ^(.*)$ http://www.domainb.com$1
> [R=301,L]
> </VirtualHost>
>
>
>
>
>
> However all requests to http://domainb.com/ gets
> redirected to http://www.domaina.com whereas the
> expected behaviour is to get redirected to
> http://www.domainb.com/ .
> Regards
> Deepan
>
> Photographic Memory Game:
> http://www.photographicmemorygame.com/
> Sudoku Solver: http://www.sudoku-solver.net/
>
>
>
> _______________________________________________
> Lula mailing list
> Lula at lula.org
> http://lula.org/mailman/listinfo/lula_lula.org
>
More information about the Lula
mailing list