I'm currently learning about Roots.io's Trellis.
In their config they have a file called 'wordpress_sites.yml' as you can see here.
After reading the Docs, I'm still confused as to what the difference is between these:
wordpress_sites:
example.com: (what is this domain used for?)
site_hosts:
- example.dev (why do I need this if I have the one above?)
Currently, my local environment seems to run off the example.dev but some plugins within my wordpress installation use 'example.com' as their path for loading resources which subsequently breaks the plugin due to it not being a real path.
Any clarity would be appreciated.
example.com
in that example is used only as a name. It isn't a domain name, even if it looks like one. It is used as an identifier.site_hosts
is a list of host names that the site will be available on. You would generally want to haveexample.com
as one of them. This lets you provide the same site on multiple hostnames.Normally you wouldn't want to make it available on multiple public-facing host names (because having duplicate sites is generally considered A Bad Idea), but it lets you have one configuration file used by both your live site and your internal-only development, test and integration sites.