Jump to:

22996 Posts in 11844 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » Running two sites from one SS install

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

Page: 1
Go to End
Author Topic: 984 Views
  • staple
    Avatar
    Community Member
    7 Posts

    Running two sites from one SS install Link to this post

    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

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: Running two sites from one SS install Link to this post

    Look into the subsites module

  • staple
    Avatar
    Community Member
    7 Posts

    Re: Running two sites from one SS install Link to this post

    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

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: Running two sites from one SS install Link to this post

    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.

  • staple
    Avatar
    Community Member
    7 Posts

    Re: Running two sites from one SS install Link to this post

    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;

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: Running two sites from one SS install Link to this post

    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.

  • staple
    Avatar
    Community Member
    7 Posts

    Re: Running two sites from one SS install Link to this post

    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/

    984 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.