I have set up staging and live site on the same machine with different document root as follows:
mysite
: Staging site without sslmysite_live
: Live site with ssl enabled
Both the sites have there own databases with same name as that of the document root respectively.
Site Urls are:
staging.mysite.org
: Staging sitemysite.org
: Live site
Whenever I try to visit my live site with the url: mysite.org
, it shows me the staging site pages and in the url it shows the http://www.mysite.org/
. From the URL it looks like the it does not take the https by default. If I type it as: https://www.mysite.org/
, this works and I get live site.
If I visit staging.mysite.org
, it shows me the staging site page. this means the staging url is working fine.
I am not getting why this is happening. And on every click on any link on live site opens the staging site pages but in the url it looks like it is live site only because the url remains as http://www.mysite.org/
.
Virtualhosts configurations as as follows:
- staging site
<VirtualHost *:80> SuexecUserGroup "#1001" "#1001" ServerName staging.mysite.org DocumentRoot /home/mysite/web/public/mysite UserDir /home/mysite/homes/*/web/public CustomLog /home/mysite/logs/access_log combined ScriptAlias /cgi-bin/ /home/mysite/cgi-bin/ ScriptAlias /fcgi-bin/ /home/mysite/fcgi-bin/ <Directory /home/mysite/web/public/mysite> Options -Indexes IncludesNOEXEC FollowSymLinks -MultiViews AllowOverride All Order allow,deny Allow from all </Directory> <Directory /home/mysite/cgi-bin> Order allow,deny Allow from all </Directory> <Directory /home/mysite/fcgi-bin> Order allow,deny Allow from all </Directory> SSLEngine off </VirtualHost>
- Live site
<VirtualHost *:80> DocumentRoot "/home/mysite/web/public/mysite_live" ServerName mysite.org <Directory "/home/mysite/web/public/mysite_live"> AllowOverride All Order allow,deny allow from all Options +Indexes </Directory> </VirtualHost> <VirtualHost *:443> DocumentRoot "/home/mysite/web/public/mysite_live" ServerName mysite.org <Directory "/home/mysite/web/public/mysite_live"> AllowOverride All Order allow,deny allow from all Options +Indexes </Directory> SSLEngine on SSLCertificateFile /home/mysite/etc/SSL/mysite.org.crt SSLCertificateKeyFile /home/mysite/etc/SSL/mysite.key SSLCACertificateFile /home/mysite/etc/SSL/mysite.org.crt </VirtualHost>
I think there is some issue with the configuration part. but not getting what it is.