Setting and environment variable for one specific subdomain matching the ServerAlias
I have a virtual host that includes the following settings
Ser开发者_StackOverflow社区verName www.host.com
ServerAlias *.host.com
Can I set
SetEnv FOO "bar"
for just a specific subdomain (like foo.host.com
)?
The answer is the SetEnvIf
directive:
SetEnvIf Host .*foo\.host\.com FOO=bar
精彩评论