You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Chris Markle <cm...@asperasoft.com> on 2010/11/03 21:39:15 UTC

[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?

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


Re: [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?

Posted by Eric Covener <co...@gmail.com>.
> but how can I specify the Substitute pattern(s) for this particular
> provider while leaving this in for another substitution provider?

I think this is a dead end, the mod_substitute filter will see all of
the Substitute directives. Maybe this is possible in 2.3 with <If>?

---------------------------------------------------------------------
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