In Gatsby Cloud, bare apex domain (e.g. mysite.com, coolapp.io, etc.) and www. subdomains (e.g. www.mysite.com, www.coolapp.io, etc.) are automatically linked as a redirect. Whichever domain you add first will act as the primary domain and the automatically added domain will be redirected to the primary domain.

For example, if you add mysite.com as a domain, Gatsby Hosting will automatically add www.mysite.com as a domain with a redirect in place. Conversely, if you first add www.mysite.com, Gatsby Hosting will automatically add mysite.com as a domain with a redirect in place.

Adding a Domain

  1. Add either an apex domain or www. subdomain to your Gatsby Hosting configuration. You can read more about adding a domain in Adding a Custom Domain.

  2. You should see a redirect pair of domains with the domain you entered as a primary domain.

    {IMAGE HERE}

  3. Follow the directions for adding DNS records for both of the domains that are listed. The apex domain will need an A Record pointed to an IP address and the subdomain will need a CNAME pointed at your Gatsby Hosting default URL, YOUR_SITE_PREFIX.gatsbyjs.io

Switching the Redirect

  1. If you want the redirected domain to be the primary domain, click the "Make Primary" button on the right-hand side of the domain listing.

    {IMAGE HERE}

Removing a Domain from a Redirect

  1. To remove a domain from the redirect, click "Remove" on the right-hand side of the domain listing. The remaining domain will act as a non-redirected domain, regardless of whether it was the primary domain or not.

    {IMAGE HERE}

    <aside> ☝ If you re-add the domain you just removed, both domains will act as primary domains without a redirect. If you need to re-add the redirect, remove both domains and start over.

    </aside>