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.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Running two sites from one SS install


7 Posts   1044 Views


2 March 2009 at 5:25pm Community Member, 7 Posts

Hi there,

I have a client with one site on Silverstripe and they want another, ideally it would run under the same install but from the viewers point of view they would not be connected.

Is this possible in Silverstripe to divert urls into separate areas and run separate templating?

Many thanks


2 March 2009 at 5:31pm Administrator, 685 Posts

Look into the subsites module :-)


6 March 2009 at 1:00pm Community Member, 7 Posts

Thanks, got that running as per the wiki article...

Does anybody know how to setup on a local machine so you can see both sites? Currently my route /client/ gets me my main site but the subsite I have setup I can not access ...

Any help appreciated



6 March 2009 at 2:40pm Administrator, 685 Posts

You'll need to access it as http://subsitename.localhost/client/

For that to work you'll need to add an entry for subsitename.localhost to your /etc/hosts file.


9 March 2009 at 12:09pm Community Member, 7 Posts

Hmmm...sorry to be a nuisance...

- I can access http://test.ubuntuguy/site/ and it goes to the same Silverstripe frontpage as http://ubuntuguy/site

- If I setup a subsite through the admin panel at either test.localhost or test.ubuntuguy I get the below erroor page when I go to http://test.ubuntuguy/site/


[Notice] Undefined index: ID
GET /sisu/

Line 43 in /mnt/hgfs/Medianoche-C/Workspace/site/sapphire/core/control/ModelAsController.php


34          $SQL_URLSegment = Convert::raw2sql($this->urlParams['URLSegment']);
35          $child = SiteTree::get_by_url($SQL_URLSegment);
37          if(!$child) {
38             if($child = $this->findOldPage($SQL_URLSegment)) {
39                $url = Controller::join_links(
40                   Director::baseURL(),
41                   $child->URLSegment,
42                   $this->urlParams['Action'],
43                   $this->urlParams['ID'],
44                   $this->urlParams['OtherID']
45                );
47                $response = new HTTPResponse();
48                $response->redirect($url, 301);
49                return $response;


9 March 2009 at 12:19pm Administrator, 685 Posts

This is a bug that will be resolved in 2.3.1, but the cause of the issue is that your new subsite lacks a home page. Go and make a home page in your new subsite in the CMS, and it should work.


9 March 2009 at 12:42pm Community Member, 7 Posts same error...

Could it be because I am re-writign the base url in .htaccess like this (it works fine for the main site)..

RewriteBase /test/