httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffery Martin <>
Subject [users@httpd] Conditionally process directives based on environment variable values in Apache conf?
Date Wed, 31 Mar 2010 18:16:08 GMT

Is there a way in the Apache conf syntax to conditionally process
directives based on a string comparison using environment variables?

I am aware of using the IfDefine directive and the -D flag of httpd,
but that functionality is not quite when I am looking for.

For example, suppose the directive I am looking for were named
"IfMatch".  I would want to do something like this.

<IfMatch ${MYVAR1} "production">
    # Directives related to production.

<IfMatch ${MYVAR1} "test">
    # Directives related to test.

<IfMatch ${MYVAR1} "development">
    # Directives related to development.

I realize that I could do the equivalent with IfDefine and 3 different
define parameters, but I am wondering if it is possible to perform the
string comparison within the Apache conf itself as I detailed above.

Thanks, All.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message