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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Working with subsite module on live server


Go to End


10 Posts   2981 Views

Avatar
VPull

Community Member, 58 Posts

10 April 2015 at 11:12pm

I have successfully installed subsite module in my main site, but when I created subdomain from cpanel it gives me 500 error.

Avatar
Pyromanik

Community Member, 419 Posts

11 April 2015 at 1:07am

CPanel does funny things. It's probably related to either permissions, folder heirarchy, or both.
It would be better if we knew what the error was. You'll need to check your logs for that.

Avatar
Nicolaas

Forum Moderator, 224 Posts

11 April 2015 at 10:38am

Hi

Sounds like you'd be better off talking to your hosting company and getting access to your error logs.... Subsites works fine in general, but of course your current setup in cpanel might not be compatible with it.

Nicolaas

Avatar
VPull

Community Member, 58 Posts

11 April 2015 at 6:06pm

Edited: 11/04/2015 6:37pm

Thanks for the quick reply.
I think silverstripe default htaccess need some modification, but what is the code I need to add in htaccess file?
It is first time that I am using subdomain with silverstripe.
error_log says- client denied by server configuration: /public_html/subdomainfolder/.htaccess

When I tried with http://www.mydomain.com/?SubsiteID=3, it works fine.
How can make it to work like http://subdomain.mydomain.com

Avatar
Jack Marchant

Community Member, 4 Posts

12 April 2015 at 11:52pm

Hi VPull,

To get a subsite working on another domain, you'll need to add the domain to the subsite, which will write to the host map php file in the subsites directory.

For domain set up, you should create a cname record for the subdomain with a value of your domain.com

Basically you want to point your subdomain to the main site, then the subsites host map file will handle the direction to the correct subsite as set up through the admin.

Hope that helps.

Avatar
VPull

Community Member, 58 Posts

13 April 2015 at 8:44pm

Thanks Jack,

I think installation of subsite module is perfect, but I am confused about CNAME record.
What should I mentioned in record, there are two values NAME and CNAME? or
instead of creating CNAME record is it ok, if I create sub domains from control panel and redirect it to main domain?

I got below code when I checked host-map file

<?php 
// Generated by Subsite::writeHostMap() on 11/Apr/15
$subsiteHostmap = array (  
  'm.mydomain.com' => 'm.mydomain.com',
);

Avatar
Jack Marchant

Community Member, 4 Posts

13 April 2015 at 9:09pm

The name should be the subdomain itself I.e "m" in m.mydomain.com and cname is the domain to which you want the subdomain to be pointed e.g. mydomain.com

The result of this should be, you type in m.mydomain.com and it loads the contents of mydomain.com while keeping m.mydomain.com in the address bar.

Your hosts map file looks fine too. Subsite module will handle the rest if you get the above domain setup right.

Avatar
VPull

Community Member, 58 Posts

13 April 2015 at 9:25pm

Edited: 13/04/2015 9:29pm

Thanks for quick reply Jack,
I followed your suggestion and added the m.mydomain.com as a NAME and domain.com as CNAME but getting default page as
http://m.mydomain.com/cgi-sys/defaultwebpage.cgi
will this process take a time?

Go to Top