I plan to use a single .htaccess file that can be deployed on multiple servers. In the process, I set the environment variables in the .htaccess file, and there are several cases where I would like to read the IP address in the settings. For example, in one case, I set an environment variable to connect to a local database:
SetEnv DBL "mysql:dbname=oars;host=192.168.101.1;port=3306"
Then in PHP I would read a variable to use interaction with the database:
define('DBL', getenv('DBL'));
Since I plan to deploy on multiple servers, is there a way to get the IP address automatically and not support separate .htaccess files for each server?
source share