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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

Configuring domains for the Subsites module


Go to End


3 Posts   2490 Views

Avatar
kat1

Community Member, 1 Post

17 December 2008 at 7:49am

I'm evaluating Silverstripe for projects that need multiple sites to be managed from the same CMS.

I've installed V2.3 and the Subsites module and set up a second site and everything looks really good in admin.

However I'm struggling to reach my newly created subsite which seems to have been given the url:

secondsite.www.firstsite.com

Presumably I need to add something to my etc/hosts file to make this site visable at the suggested URL. Anyone know what I need to do?

Secondly, and more importantly to me, how do I configure additional sites to operate on totally separate URLs?

For example: www.firstsite.com, www.secondsite.com etc.

It looks as if the construcion of the url shown in the Silverstripe admin might make this impossible.

Can someone clarify what the possible options are and how they might be implemented?

Many thanks.

Avatar
Sam

Administrator, 690 Posts

19 December 2008 at 12:25pm

Hi kat1,

You want to use the Subsite::set_allowed_domains() in _config.php

Here's an example:

Subsite::set_allowed_domains(array(
'yoursite.com',
'org.nz',
'co.nz',
'com',
'org',
));

This will let you create subsites such as "wellington.yoursite.com". However, because org.nz, co.nz, etc are also listed, you could create 'somethingcompletelydifferent.org.nz'.

Note that you shouldn't include "www." in any of the site names - if you subsite is called 'wellington.yoursite.com' then 'www.wellington.yoursite.com' will also work too.

Avatar
Sam

Administrator, 690 Posts

19 December 2008 at 12:48pm