Domains on staging and multidevs
Give staging or a multidev a name under your live domain, such as staging.example.com, or a wildcard for every name under it, and set its DNS records.
Custom domains belong to live. Staging, premium staging, and multidev environments can use names under a domain that is connected to live. If live has example.com, staging can use staging.example.com or dev.example.com, and a multidev can use pr-12.example.com.
Before you start
Connect the domain to live first. Open your site, switch to Live, open Domains, and add the domain there. Once it shows Active or Securing your site, staging can use names under it.
If live has no connected domain, the Domains tab of staging says so and links to live.
Add a name to staging or a multidev
- Open your site, switch to the staging or multidev environment, then open Domains.
- Choose Add a subdomain of your live domain.
- Pick the live domain, then type the name in front of it, such as
staging. The dialog shows the full name. - Choose Add name.
- The dialog shows the exact DNS records to set, as for live: a CNAME at the name that points to
sites.avaloi.com, and a CNAME at_acme-challenge.<name>for the server certificate. If the domain's DNS is on Cloudflare DNS, Avaloi writes them for you.
The name shows in the list with its status. Remove it from its menu.
Use a wildcard
Tick Use a wildcard (*.example.com) to send every name under the domain to this environment. You set one record at your DNS provider:
| Type | Name | Value |
|---|---|---|
| CNAME | *.example.com |
sites.avaloi.com |
| CNAME | _acme-challenge.example.com |
<your site id>.acme.sites.avaloi.com |
The second record is the one live already uses for example.com. If it is there, you are done. On Cloudflare DNS, Avaloi writes the wildcard record into your zone.
Names that have their own record keep it. Live keeps example.com and www.example.com.
Each name under the wildcard gets its own certificate the first time it is added. Avaloi runs your sites on Cloudflare's plan for SaaS platforms, and that plan has no wildcard certificates. So add each name you use, such as pr-12.example.com, with Add a subdomain of your live domain. With the wildcard in place it needs no new DNS record. A name under the wildcard that was not added shows a Cloudflare error when someone visits it.
When the domain's DNS is on Cloudflare DNS and the wildcard sits at the root of the zone, such as *.example.com in the zone example.com, the Avaloi server also gets one certificate per name rather than one for the wildcard.
Which environment answers
The most specific name wins:
- A name added on its own goes to its environment.
pr-12.example.comon a multidev goes to that multidev, even with*.example.comon staging. - Live keeps its own names, such as
example.comandwww.example.com. - Any other name under the wildcard goes to the environment that holds the wildcard.
Limits
- Up to 10 names per site on staging and multidevs together. A wildcard counts as one.
- One wildcard per live domain.
- Each name works on one environment at a time. To move a name, remove it, then add it on the other environment.
- No apex of a domain that is not on live, and no domain that is not under a live domain.
- The primary domain is a live setting. Staging and multidevs keep their temporary domain as primary.
If the API refuses a name, it says why in one sentence, with one of these codes: live_not_launched, live_domain_required, not_under_live_domain, hostname_taken, staging_domain_limit, www_live_only, or primary_live_only.
When the live domain goes
If you remove a domain from live, Avaloi removes the staging and multidev names under it too, and the job log says which ones. A name that another live domain still covers stays. For example, dev.shop.example.com stays when example.com goes but shop.example.com remains on live.
Deleting a multidev removes its names as well.
With an AI assistant
The add_domain tool takes an environment, such as staging or a multidev name, and follows the same rules. get_domain_status takes it too.
Still stuck?
Email [email protected] with your site name and what you tried, or send us a message.