Domains

The Domains section of your environment allows you to specify which domains an environment will listen on. The CNAME and/or A record details are also listed on this page - give these to your domain provider when you are ready to point your domains towards Silverstripe Cloud.

Specifying domains

Specify the domains that your site will listen on by adding them to the table. You will also need to configure these with your domain provider - see “Configuring your domains with your domain provider” for more information.

Changing domains requires a full deployment.

Primary domain

Once you have specified your domains, you can designate which of these should be used for command line scripts.

The primary domain is used for CLI requests anywhere that Silverstripe CMS needs to know the domain that applies for that request - it is the equivalent of setting the SS_BASE_URL environment variable. One example where this domain will manifest is in the emails sent by any command line scripts containing dynamic links back to your site (e.g. through the use of $Link, $BaseURL etc in templates).

Redirecting to www

Tick the www checkbox next to the domains you would like to be redirected to the www variant of that domain, e.g. ticking the box by the mysite.com domain will automatically make the environment listen to www.mysite.com as well as mysite.com, and permanently redirect all users to the www variant.

We recommend redirecting your root domains to the www variant due to DNS limitations regarding A and CNAME records. Setting a CNAME record for the root domain is not always supported, and can sometimes cause problems with other records on a domain. See “Configuring your domains with your domain provider” section for more information.

Please contact Service Desk if you have any trouble setting up your domain redirection.

Redirecting to HTTPS

Tick the HTTPS checkbox next to the domains you would like to redirect to HTTPS, e.g. users going to http://www.mysite.com will be permanently redirected to https://www.mysite.com.

Make sure you have an SSL certificate configured for the domains you specified as HTTPS, otherwise a default certificate will be used and will cause browser errors.

This approach is preferable to redirections via .htaccess, since it applies to all requests to a specific domain (not just ones handled by Apache). It’s separate from URL Rules, which deal with path-based redirects. Using SSL consistently on websites is considered best practice, but if you need conditional SSL redirects, please refer to Director::forceSSL().

Configuring your domains with your domain provider

Here we explain how to configure domains to point to Silverstripe Cloud.

If you see a CNAME and an A value listed on the Domains page:

  • Set all non-root domain records to the CNAME value shown, e.g. cluster-mystack-prod-1234567.ap-southeast-2.elb.amazonaws.com
  • If your provider supports CNAMEs on root domain records (typically denoted with @), also configure it to the CNAME value shown
  • If your provider doesn’t support CNAMEs on root domain records point your root domains to the A value shown, e.g. 52.64.66.93 and enable www redirection (see “Redirection to www” section)

If you see just an A value on the Domains page:

  • Set all domain records to the A value shown, e.g. 52.64.66.93

Domain change-over process

Example of a change-over would be:

  1. Lower the TTL on your current domains at your domain provider a few days prior to the change-over
  2. Change your domain provider details (see “Configuring your domains with your domain provider” section)
  3. Wait while your DNS propagates across the internet nameservers
  4. You website should now be served from the Silverstripe Cloud
  5. Increase the TTL back to the initial setting

Please contact Service Desk if you have any trouble switching over your domains.

Was this answer helpful? Yes No

Sorry we couldn't be helpful. Help us improve this article with your feedback.