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


Reply


7 Posts   1108 Views

Avatar
staple

Community Member, 7 Posts

2 March 2009 at 5:25pm

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

Avatar
Sam

Administrator, 685 Posts

2 March 2009 at 5:31pm

Look into the subsites module :-)

Avatar
staple

Community Member, 7 Posts

6 March 2009 at 1:00pm

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

http://doc.silverstripe.com/doku.php?id=modules:subsites#set_the_domains_for_your_subsites

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

Gwilym

Avatar
Sam

Administrator, 685 Posts

6 March 2009 at 2:40pm

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.

Avatar
staple

Community Member, 7 Posts

9 March 2009 at 12:09pm

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

Source

34          $SQL_URLSegment = Convert::raw2sql($this->urlParams['URLSegment']);
35          $child = SiteTree::get_by_url($SQL_URLSegment);
36          
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                );
46                
47                $response = new HTTPResponse();
48                $response->redirect($url, 301);
49                return $response;

Avatar
Sam

Administrator, 685 Posts

9 March 2009 at 12:19pm

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.

Avatar
staple

Community Member, 7 Posts

9 March 2009 at 12:42pm

Hmmm...no 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/