Multiple Domains & Databases
The main site works fine and is installed in the root directory (/). I have created a new DB and folder /site1 installed and configured c5 without issues using mainsite.com/site1. Now I want to push the site live I can't get the forwarding to work correctly.
Basically newsite.com needs to go directly to the /site1 directory however it just ends up at mainsite.com and displaying the mainsite
I have tried pointing the newsite.com domain to the /site1 directory from the hosting control panel but that didn't work. The site.php is configured for the correct db and the base_url and dir_rel look ok??
Any ideas welcomed!
But if I understand the BASE_URL config parameter correct your site would have:
Although I would try it without the base_url parameter because concrete5 will auto detect this in most cases and automatically set DIR_REL and BASE_URL.
Unfortunately neither worked. Investigating further this seems to be an issue with the .htaccess file. As the main site is the / directory therefore so is the .htaccess file for the main site - it's servicing all other requests which is why it keeps going back to the main. Hopefully there is a way of rewriting the htaccess to service multiple domains in the one root.
Have a look at "Running several name-based web sites on a single IP address".
/ -> c5 instance 1
/site1 -> another c5?
That's not a good solution having a c5 instance inside another c5 instance. Better do the following:
and so on. And then point the domains via the hosting panel to these folders.
Otherwise (as you pointed out correctly) everything from the root will be catched by the first instance's htaccess file.
Thanks for the support, much appreciated!
Setting up a multisite environment in Concrete5:
Domain Mapper Add on:
Admittedly, slightly wavering from your OP; however, tangentially related.
I uncommented the following to include httpd-vhosts.conf in httpd.conf
# Virtual hosts Include conf/extra/httpd-vhosts.conf
added this to end of httpd.conf
#BEGIN Concrete 5 centralization alias Alias /concrete "D:/sites/C5_core/Concrete5 Version 220.127.116.11/concrete" php_value include_path "../C5_core/Concrete5 Version 18.104.22.168/" #END Concrete 5 centralization alias
in httpd-vshosts.conf added this block (edited with correct paths and aliases) for each site
<VirtualHost *:80> ServerAdmin firstname.lastname@example.org DocumentRoot "D:/sites/site1" ServerName www.yourdomain.com ServerAlias yourdomain.com *.yourdomain.com ErrorLog "D:/sites/site1/logs/concrete-error.log" CustomLog "D:/sites/site1/logs/concrete-access.log" common </VirtualHost>
Now, for each update of C5 I download the zipped archive and unzip the concrete folder to "D:/sites/C5_core/Concrete5 Version X.X.X/" and then just change the version number in httpd.conf.
My folder structure would be as follows:
I hope this helps.
Edit to say I'm on Windows server, but it's the same in general on all systems, I believe.