I'm using the below to set a client env variable which my system requires.
SetEnvIf HOST "^(\w+).domain.com" CLIENT_ID=$1 UseCanonicalName Off VirtualDocumentRoot /home/user/clients/%-3/
I'm including this in a vhost.conf on my main domain and it seems to be working, however the DOCUMENT_ROOT isn't being set on line 3 - it remains as the main domain doc root. I've tried with and without
What's missing here from this config? I can load files under the document root but the SERVER['DOCUMENT_ROOT'] is always /usr/local/apache/htdocs
I also need this config to 404 correctly if the folder under 'clients' doesn't exist.
I should note that our systems allows all sites to run from a single index.php which is aliased in another virtual host include as:
Alias /index.php /home/public/index.php
This means content is served using the above config, and correctly, just the doc root isn't being set correctly.
It looks like this https://issues.apache.org/bugzilla/show_bug.cgi?id=26052 is my document root problem.
Will try to update and come back with my findings.