From: Vincent Bray Date: Mon, 22 Oct 2007 16:51:31 +0000 (+0000) Subject: mod_substitute module docs, first bash. X-Git-Tag: 2.3.0~1320 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7740055c94a4766bd8c92c9a65c94c304bdf0da0;p=apache mod_substitute module docs, first bash. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@587150 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/mod_substitute.xml b/docs/manual/mod/mod_substitute.xml new file mode 100644 index 0000000000..e0c2ec7733 --- /dev/null +++ b/docs/manual/mod/mod_substitute.xml @@ -0,0 +1,90 @@ + + + + + + + + + +mod_substitute +Perform search and replace operations on response bodies +Experimental +mod_substitute.c +substitute_module + + +

mod_substitute provides a mechanism to perform + both regular expression and fixed string substitutions on + response bodies.

+

This is an experimental module and should + be used with care.

+
+ + +Substitute +Pattern to filter the response content +Substitute s/pattern/substitution/[inf] +directory +.htaccess +FileInfo + + +

The Substitute directive specifies a + search and replace pattern to apply to the response body.

+ +

The meaning of the pattern can be modified by using any + combination of these flags:

+ +
+
i
+
Perform a case-insensitive match.
+
n
+
By default the pattern is treated as a regular expression. + Using the n flag forces the pattern to be treated + as a fixed string.
+
f
+
The f flag causes mod_substitute to flatten the + result of a substitution allowing for later substitutions to + take place on the boundary of this one.
+
+ + Example + <Location /> + + AddOutputFilterByType SUBSTITUTE text/html
+ Substitute s/foo/bar/ni
+
+ </Location> +
+ +

If either the pattern or the substitution contain a slash + character then an alternative delimiter should be used:

+ + Example of using an alternate delimiter + <Location /> + + AddOutputFilterByType SUBSTITUTE text/html
+ Substitute "s|<BR */?>|<br />|i" +
+ </Location> +
+
+
+ +