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.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

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

How to use a subdomain in the same SS install


Go to End


1339 Views

Avatar
nicktacular

Community Member, 8 Posts

6 May 2010 at 2:54am

Edited: 06/05/2010 2:58am

Hi there,

Currently I have a SS installation for a domain, example.com in a directory /mywebroot.

What I am trying to do is to create a subdomain such as customapi.example.com which will use a a particular controller such as /mywebroot/custom/code/MyCustom.php.

I can already access this controller by accessing example.com/customabc because I defined the routes in my /mywebroot/custom/_config.php. However, I wish to have this controller accessible from the root of the subdomain customapi.example.com so that it runs the controller called MyCustom_Controller inside /mywebroot/custom/code/MyCustom.php as the default controller.

Is this possible? If so, is this something to address inside /mywebroot/.htaccess, or is this a module, or....?

I would appreciate any pointers!

Thanks,

Nick