Casey Bralla on 28 Apr 2008 18:03:25 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Multiple Domains - Apache


On Monday 28 April 2008 7:36:45 pm Deepan wrote:
What you have looks like it should work.  I am ding the same thing, but it 
works just fine.  Here are my relevant lines:



NameVirtualHost *




# www.NerdWorld.org            NerdWorld
<VirtualHost *>
    ServerAdmin webmaster@NerdWorld.org
    DocumentRoot /www/NerdWorld.org
    ServerName www.NerdWorld.org
    ErrorLog /var/log/apache/NerdWorld.org.log
    CustomLog /var/log/apache/NerdWorld.org.log common
</VirtualHost>



# www.Bralla.com            Bralla
<VirtualHost *>
    ServerAdmin webmaster@Bralla.com
    DocumentRoot /www/Bralla.com
    ServerName www.Bralla.com
    ErrorLog /var/log/apache/Bralla.com.log
    CustomLog /var/log/apache/Bralla.com.log common
</VirtualHost>






> 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/
>
>
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --        http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug



-- 


Casey Bralla
Chief Nerd in Residence
The NerdWorld Organisation
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug