Using the same environment setup files in two different domains

Hi all!

I have a Grav website installed on a domain, let’s say grav.local. For security reasons, I can only access the admin using this domain, but this website is publicly accessible on another domain, let’s say grav.com.

Grav, as expected, created two env folders, one for grav.local and another for grav.com. The problem is that I can only edit the grav.local files, as mentioned above.

How can I point to the configs of grav.local when accessing grav.com? Or in another words, can I get rid of the environments and have a single folder with configs, no matter the environment?

Thanks in advance!

Did you check Grav environment docs?

I did @Karmalakas , and I’m using them to separate configs between dev, quality and production environments.

My issue is with production, where the company hosting the website forces me to make edits in one domain (grav.local) that’s behind a VPN but the public facing address is grav.com, so environments won’t work here I believe since updates on grav.local don’t show up in grav.com.

So the question is: can I get rid of environments in production and just have a single config folder used by all domains?

Thanks!

From the docs I understand you can define the environment via config on each server. So if you define same env in both cases, it should work.

Sorry, didn’t try myself, so I might be mistaken

I ended up going with the simpler route, no envs and just using the default config. Like this, no matter the URL, they all use the same config.
Thanks for the help @Karmalakas!

1 Like