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

How to use subdomains?

Go to End

8 Posts   2090 Views


1 Post

28 September 2007 at 5:00pm

Hello all,

Is there a way to utilize subdomains within a single SilverStripe installation? Since SS does not support multi-level directory hierarchies yet, I'm looking for a way to 'organize' the site and separate some of the content. So ideally, I could have:

but page78 and page84 would not be available on Is this possible? I searched the forum and docs and didn't see many references to using subdomains.




Forum Moderator, 922 Posts

28 September 2007 at 5:30pm

There is the option in the 'Behaviour' tab on any page for specifying a domain, or multiple domains.

However, am I correct in assuming you want to block off certain pages dependant on the domain you're currently on? If that's the case, we don't have that certain functionality, but we do have the ability to do what you're looking for half of it.



Forum Moderator, 628 Posts

30 September 2007 at 8:00pm

You could use modify the Access system that comes with 2.1 to do this.

Or you could use the subsites module that is in Subversion/Dailybuilds, which would do exactly what you want; it allows you to run several websites from the one installation and share content/structure between the two. However, we've not yet had time to properly document it...

Finally, do realise that silverstripe is really quite OO and built to let you play and achieve what you want; rather that come up with every possible idea someone needs, we give you the framework to let you do it yourself :)


Community Member, 501 Posts

1 December 2007 at 2:18am

Edited: 01/12/2007 2:37am

What do I write in that field 'domains'?

Suppose I want the page to be

Do I write:


It's not clear to me what the field expects...

And anyone experience with doing this in combination with dreamhost and setting up subdomains there?

I've setup the subdomain in the panel and it works, but it's not pointing to the page of my SS-site, which seems logical as the subdomain is just a new directory in my root folder

so I have the directory 'mysite' and besides that, on the same level, 'test.mysite' so it makes sense to me that it doesn't work....

If I change it so that the directory of the subdomain points to then I get an error when visiting the page

sapphire/main.php was not found on this server.

Which seems logical because there is nothing in that directory...


Community Member, 501 Posts

1 December 2007 at 3:31am


apparently I have to point my subdomain to the same root as the main domain..
so both have to point to the root of the directory.

I probably want the base-tag to stay the same though (, but that can't be too hard.


Forum Moderator, 628 Posts

4 December 2007 at 3:37pm

Dio5, can you document which of the following was needed?

> Do I write:
> test
> test.mysite


Community Member, 501 Posts

5 December 2007 at 11:01am

yeah sure:

Apparently, RootURLController.php checks for $_SERVER['HTTP_HOST'];
The field in the backend just goes into a single field in the database table of SiteTree.


Forum Moderator, 628 Posts

5 December 2007 at 11:41am

Sweet ...