Environment variables across different domains

Scenario: A website is built (Github, Gatsby, Netlify) and has embedded environment variables to set the page title. The same website code is used for multiple web domains. Is it possible to have specific environment variables for each domain so that when a domain is visited, the page shows data specific to that domain? For example, when visiting john.com, the page shows “Welcome to John’s website,” and when visiting susan.com, it shows “Welcome to Susan’s website.”

@ruegen Yes, although this could also be achieved many other ways, in particular instead of “defining content within the environment variables” you could use only a single identifier so the build knows which site to produce/output.

For the environment variable documentation see:

2 Likes