0

I need to use a different PHP php_value include_path for each subdomain. The problem ist, that the subdomains are depending on the folders I have:

<VirtualHost *:443>
        ServerName subdomain.domain.com
        ServerAlias *.subdomain.domain.com
        VirtualDocumentRoot "/var/www/subdomains/%1"
</VirtualHost>

So I tried to save the current subdomain as a variable:


SetEnvIf Host "^([^.]*).subdomain.domain.com$" SUBDOMAIN=$1
Define CURR %{ENV:SUBDOMAIN}

php_value include_path ".:/var/www/subdomains/${CURR}/php"

But the content of CURR is "%{ENV:SUBDOMAIN}". Is it possible to use Define to get an env variable, which will work for php_value?

Coli
  • 927
  • 8
  • 28
  • does the subdomains contain the same php code or each one have a different code ? – Vidal Jun 15 '20 at 11:41
  • Each one have a different version like different git branches. – Coli Jun 15 '20 at 12:28
  • Use PHP to [determine the subdomain from the URL](https://stackoverflow.com/questions/5292937/php-function-to-get-the-subdomain-of-a-url) – kmoser Jun 15 '20 at 14:11

0 Answers0