Thursday, 13 November 2008

Adding a subsite in Silverstripe

Assuming you've got the subsites module installed and created your first subsite 'Template' manually, you can now go about adding subsites!

Click on the Sub-sites tab at the top of the Silverstripe CMS to add a new subsite.

You will see this panel on the left hand side. Just enter a name and subdomain and click add.

You can see I've already added two domains here which point to http://sub1.localhost and http://sub2.localhost

Each new subsite is based on a 'Template', so in this case will have the domain 'mysite.com' appended.

I first tried setting this up in my home directory but Silverstripe could not resolve addresses of the form http://sub1.localhost/~username/

Once I installed Silverstripe to the main apache Documents folder it worked no problem, i.e. Silverstripe will resolve http://whatever.localhost/

In my case, because I'm developing locally I added the following entries to my /etc/hosts file:

127.0.0.1    sub1.localhost
127.0.0.1 sub2.localhost


Happy subsiting...

No comments: