Domains

The Domains section of the Platform Dashboard 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 Platform.

Domains screen

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.

This is used to emulate the HTTP_HOST environment variable when scripts such as cron jobs are run from the command line. 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).

See Environment management docs for how this is used.

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 Helpdesk 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 your domains to point to SilverStripe Platform.

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 Platform
  5. Increase the TTL back to the initial setting

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