Example.com vs example.dev a typo?

I’ve noticed that in trellis/group_vars/staging/wordpress_sites.yml and trellis/group_vars/development/wordpress_sites.yml at line 7 it says “example.com” but subsequent lines (such as 8 and 10) reference .dev.

I assumed that example.com references were just a typo and that it mean “Just put the same domain here as everywhere else.”

But I’ve had so many unexpected errors along the way I’m wondering if I misunderstood. Can anyone clarify for me? Thank you!

example.com is the name of the site. It’s just our recommendation/common use case that it’s named after your “production” domain. You could name this anything you want (including a non-domain form).

example.dev is the host in that case. So it varies per-environment. So in development its .dev. In production its .com.

1 Like

So in development/wordpress_sites.yml it would be acceptable to look like this:

And staging/wordpress_sites.yml to look like this:

And production/wordpress_sites.yml to look like this:

Noting that the domain is different in each.

No, the name/key doesn’t change. Which is why its example.com by default across envs.

The docs say

Each site starts with a “key” (example.com in this case). Trellis uses the key internally as the name of the site and as a default value in a lot of variables. We recommend naming your sites after their domain so it’s descriptive.

1 Like

The easiest, most supportable way to handle that is to use the same key (see @swalkinshaw’s explanation above, he calls it the name) in every wordpress_sites.yml

And most importantly the key (again, see definition above) line in each vault.yml file must also match the key in wordpress_sites.yml.

Okay, thanks for clarifying. When I read that statement in the docs I wasn’t sure if it mean that should be across each, or contextual.

Thank you, this may have been the root of the ongoing issues I’ve been having.

Along the same lines of this, in reference to trellis/hosts/ would these be correct:


And production

And development is untouched.