httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Markle <cmar...@asperasoft.com>
Subject [users@httpd] How to specify distinct "groups" of Substitute patterns with mod_substitute and mod_filter, one group for one substitute provider and another group for another provider?
Date Wed, 03 Nov 2010 20:39:15 GMT
Basically I have a working configuration of mod_substitute and
mod_filter that always attempts substitution in text/* content. It's
configured roughly like this:

LoadModule substitute_module modules/mod_substitute.so
LoadModule filter_module modules/mod_filter.so

FilterProvider gzinflate INFLATE resp=Content-Encoding $gzip
FilterProvider replace SUBSTITUTE Content-Type $text/
FilterProvider gzdeflate DEFLATE Content-Type $text/
FilterChain gzinflate replace gzdeflate

Substitute "s|one thing|another thing|"

Now suppose I want to add another set of substitution to that
configuration, but they are conditional. Say for example if the
FOO_BAR environment variable value is "1" then I want to do some
additional substitutions. I see I can add something like

FilterProvider conditionalreplace SUBSTITUTE env=FOO_BAR 1

but how can I specify the Substitute pattern(s) for this particular
provider while leaving this in for another substitution provider?

I'd see the config like something like this but I don't see how to
specify one set of Substitute patterns that are affiliated with the
"replace" provider and a distinct set of Substitute patterns
affiliated with the other "conditionalreplace" provider".

[...]
FilterProvider gzinflate INFLATE resp=Content-Encoding $gzip
FilterProvider replace SUBSTITUTE Content-Type $text/
FilterProvider conditionalreplace SUBSTITUTE env=FOO_BAR 1
FilterProvider gzdeflate DEFLATE Content-Type $text/
FilterChain gzinflate replace conditionalreplace gzdeflate

# substitute this all the time (i.e., for the "replace" provider)
Substitute "s|one thing|another thing|"

# substitute this conditionally (i.e., for the "conditionalreplace" provider)
# ??? but how are these patterns "separated" from the ones above ???
Substitute "s|yet another thing|really yet another thing|"

Thanks in advance for any tips on this...

Chris

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message