Hello @prashanth55,
Not sure if it's too late to answer.
But not sure how wise it would be to write logic in vhost config, rather you can do the following:
- Create environment specific (dev2, dev, stage, prod) .vars files as follow:
/etc/httpd/conf.d/variables/domains_${ENV_TYPE}.vars
//contain...