Multiple Domains & Databases
Permalink
Hi - I need to run multiple websites each with it's own domain name, pointing to a unique directory under one hosting account.
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??
define('BASE_URL', 'http://newsite.com');
define('DIR_REL', '/site1');
Any ideas welcomed!
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??
define('BASE_URL', 'http://newsite.com');
define('DIR_REL', '/site1');
Any ideas welcomed!
Maybe you can try a .htaccess 301 redirect (Google for the correct way to do this)
There is an option "'REDIRECT_TO_BASE_URL" which I guess triggers the redirect to your main folder:
http://www.concrete5.org/community/forums/usage/changing-base-url-h...
But if I understand the BASE_URL config parameter correct your site would have:
define('BASE_URL','http://newssite.com/site1');
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.
http://www.concrete5.org/community/forums/usage/changing-base-url-h...
But if I understand the BASE_URL config parameter correct your site would have:
define('BASE_URL','http://newssite.com/site1');
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.
Thanks for the responses.
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.
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.
If you have access to your apache configuration, virtual hosts may be an option. see:
http://httpd.apache.org/docs/2.0/vhosts/examples.html...
Have a look at "Running several name-based web sites on a single IP address".
http://httpd.apache.org/docs/2.0/vhosts/examples.html...
Have a look at "Running several name-based web sites on a single IP address".
Ah okay, if I understand correctly you have the following structure:
/ -> c5 instance 1
/site1 -> another c5?
That's not a good solution having a c5 instance inside another c5 instance. Better do the following:
/site1/
/site2/
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.
/ -> c5 instance 1
/site1 -> another c5?
That's not a good solution having a c5 instance inside another c5 instance. Better do the following:
/site1/
/site2/
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.
Worked thanks. Good house keeping practice too.
Thanks for the support, much appreciated!
Thanks for the support, much appreciated!
Some links you might not have seen:
Setting up a multisite environment in Concrete5:
http://www.concrete5.org/documentation/how-tos/developers/setting-u...
Domain Mapper Add on:
http://www.concrete5.org/marketplace/addons/domain_mapper/...
Admittedly, slightly wavering from your OP; however, tangentially related.
Setting up a multisite environment in Concrete5:
http://www.concrete5.org/documentation/how-tos/developers/setting-u...
Domain Mapper Add on:
http://www.concrete5.org/marketplace/addons/domain_mapper/...
Admittedly, slightly wavering from your OP; however, tangentially related.
This is what I did.
I uncommented the following to include httpd-vhosts.conf in httpd.conf
added this to end of httpd.conf
in httpd-vshosts.conf added this block (edited with correct paths and aliases) for each site
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:
D:/sites/C5_core
D:/sites/site1
D:/sites/site2
I hope this helps.
Edit to say I'm on Windows server, but it's the same in general on all systems, I believe.
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 5.4.2.2/concrete" php_value include_path "../C5_core/Concrete5 Version 5.4.2.2/" #END Concrete 5 centralization alias
in httpd-vshosts.conf added this block (edited with correct paths and aliases) for each site
<VirtualHost *:80> ServerAdmin webadmin@yourdomain.com 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:
D:/sites/C5_core
D:/sites/site1
D:/sites/site2
I hope this helps.
Edit to say I'm on Windows server, but it's the same in general on all systems, I believe.