Setting the subdomain as a variable in apache config to be used in the same config file:

Viewed 1623
  1. How to define dynamically the subdomain of wildcard address as a variable in apache configuration file ?
  2. How can I call the enviroment variable in configuration file of apache ? This option here doen't work: Create an Apache SetEnv variable with the subdomain name in case of wildcard It seems it doesn't work.

I've tried:

setting the enviroment virable:

  • SetEnv SUBDOMAIN subdomainx
  • SetEnvIf Host "^([^.]*).domainx.tldx$" SUBDOMAIN=$1
  • SetEnvIf Host "^([^.]*).domainx.tldx$" SUBDOMAIN=specificsubdomainx
  • Define SUBDOMAIN %-3

retrieving the variable in the same config file:

  • ${SUBDOMAIN}
  • %{SUBDOMAIN}
  • SUBDOMAIN

Please help, Its freaking me out. Thanks

1 Answers
Related