Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

multi-host support

Go to End

8 Posts   2875 Views


28 Posts

31 July 2007 at 10:05am

I noticed that _config.php sets a project variable.
In support of consolidated code does silverstripe
support multiple projects at the same time.

If so how would you configure it? If possible
I'd like to use a virtual host server to host
multiple domain-names. Normally I would
put a copy of silverstripe in each doc_home
but from the way _config.php sets the project
I'm wondering if there is a way to bypass the
multiple copies of silverstripe.


Community Member, 231 Posts

31 July 2007 at 10:53am

There is current no way to do this currently (to my knowledge).


Administrator, 685 Posts

31 July 2007 at 5:16pm

The project variable lets you change the name of the 'mysite' folder to something else. In our internal development environment, we have each sites project-specific folder named differently.

If you're wanting to do code-consolidation, the best bet is to experiment with symbolic links.

* Move the sapphire, cms and jsparty folders to some common place.
* Add symlinks for them in each of your projects.


Community Member, 8 Posts

26 October 2008 at 10:54am


For developing i'm also working with symbolic links. But i got a problem with the "assets" Folder. In the Media Manager it tries to get to the folder relativ (../assets), and start looking in the common source folder for the image. finally it ends up in a fatal error, that it couldn't find the file. Is it importent that it looks for the file relativ, or could it be changed in an absolute path? Or is there a better way to fix that?




Community Member, 49 Posts

4 November 2008 at 9:56pm

Does anybody has a patch for this problem? I'm willing to run 100+ SilverStripe sites on a server and need symbolic links for space and performance (caching!) efficiency.


Community Member, 787 Posts

4 November 2008 at 11:23pm



Community Member, 8 Posts

16 November 2008 at 2:40am

Edited: 16/11/2008 2:41am


I added that issue as an bug. You can find it under

best regards



Community Member, 12 Posts

18 November 2008 at 7:49pm

I achieved this with sub-domains. Change your _config.php to do the following:

if (isset($_SERVER['SERVER_NAME'])) {
	$servername = $_SERVER['SERVER_NAME'];
	$domainpart = explode(".", $servername, 2);
	$database = $domainpart[0];
} else {
	die('..or you can configure to redirect to a default location.');

and then change the database accordingly:

global $databaseConfig;
$databaseConfig = array(
	"type" => "MySQLDatabase",
	"server" => "localhost", 
	"username" => "username", 
	"password" => "password", 
	"database" => $database,

But the fact remains that you can't use multiple paths for the assets folder depending on the sub-domain, or at least I could not figure that out. If there is a function like Filesystem::setAssetsPath() please let me know.