My question is related to the wrong redirection of multi-domain server.
I have a VPS server on ovh.com with 2 domains names:
site1.com
site2.com
On OVH admin panel, I have set up the DNS zone so that each site return to the IP adress of the server with a type A
. Each www.siteX.com
have for targetsiteX.com
with a type CNAME
.
On the server side, I'm using Apache2 and I have created for all a conf file in /etc/apache2/site-available/
:
site1.conf
site2.conf
with the same structure:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName siteX.com
ServerAlias www.siteX.com
DocumentRoot /var/www/siteX
</VirtualHost>
Then I have used the command a2ensite subX.conf
or a2ensite siteX.conf
and sudo service apache2 restart
The problem I have is that www.site2.com
is redirected to site1.com
while site2.com
is correct and return site2
.
The interesting aspect is that www.site2.com?
is correctly loading the content of site2 while keeping the www.site2.com/?
in the url.