I've been trying to wrap my head around a request. I have an app and the client now wants to separate the data into two regional "portals". The app would be identical in all respects except for the database. I'm trying to avoid using virtual hosts and maintaining separate app folders.
I've thought of a few different options like a drop-down in the login to select the portal. Then set the database based on the selection. Doable but more work.
My next thought is to create two subdirectories. In each is an htaccess file that sets an environment variableand an index.php that changes directory back to document root and loads index.php. Seems doable but I'm not much of an htaccess guru.
Any pointers or suggestions would be greatly appreciated. Just trying to fulfill the request with the least amount of work and resources.
Currently that sets the environment based on the environment variable, and if not present to "development". But you can use any logic there to determine a custom environment. It all depends on what defines a "region".
Thanks Harro. I don't know why I always try to do things the hard way. I'll use two subdirectories with environment variables, adjust htaccess, set the databases in config, and copy index.php to each subdirectory adjusting paths to point to app and core. Then, in the root, I'll have an index.php that says no direct access. Assets should work as is (I hope). Done.