mod_substitute.xml revision 2f46ce2a814d7f2b126dfb9f1b25fd64e2fbdc11
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl<!-- $LastChangedRevision$ -->
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl Licensed to the Apache Software Foundation (ASF) under one or more
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl contributor license agreements. See the NOTICE file distributed with
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl this work for additional information regarding copyright ownership.
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl The ASF licenses this file to You under the Apache License, Version 2.0
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl (the "License"); you may not use this file except in compliance with
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl the License. You may obtain a copy of the License at
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl Unless required by applicable law or agreed to in writing, software
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl distributed under the License is distributed on an "AS IS" BASIS,
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl See the License for the specific language governing permissions and
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl limitations under the License.
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl<description>Perform search and replace operations on response bodies</description>
2f46ce2a814d7f2b126dfb9f1b25fd64e2fbdc11rbowen<compatibility>Available in Apache HTTP Server 2.2.7 and later</compatibility>
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl <p><module>mod_substitute</module> provides a mechanism to perform
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl both regular expression and fixed string substitutions on
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl response bodies.</p>
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl<directivesynopsis>
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl<description>Pattern to filter the response content</description>
ca33b922ae8ad1b24a8235b656b0ac6f82915355jim<syntax>Substitute <var>s/pattern/substitution/[infq]</var></syntax>
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl <p>The <directive>Substitute</directive> directive specifies a
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl search and replace pattern to apply to the response body.</p>
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl <p>The meaning of the pattern can be modified by using any
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl combination of these flags:</p>
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl <dd>By default the pattern is treated as a regular expression.
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl Using the <code>n</code> flag forces the pattern to be treated
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl as a fixed string.</dd>
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl <dd>The <code>f</code> flag causes mod_substitute to flatten the
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl result of a substitution allowing for later substitutions to
ca33b922ae8ad1b24a8235b656b0ac6f82915355jim take place on the boundary of this one. This is the default.</dd>
ca33b922ae8ad1b24a8235b656b0ac6f82915355jim <dd>The <code>q</code> flag causes mod_substitute to not
ca33b922ae8ad1b24a8235b656b0ac6f82915355jim flatten the buckets after each substitution. This can
ca33b922ae8ad1b24a8235b656b0ac6f82915355jim result in much faster response and a decrease in memory
ca33b922ae8ad1b24a8235b656b0ac6f82915355jim utilization, but should only be used if there is no possibility
ca33b922ae8ad1b24a8235b656b0ac6f82915355jim that the result of one substitution will ever match a pattern
ca33b922ae8ad1b24a8235b656b0ac6f82915355jim or regex of a subsequent one.</dd>
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl <Location />
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl </Location>
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl <p>If either the pattern or the substitution contain a slash
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl character then an alternative delimiter should be used:</p>
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl <example><title>Example of using an alternate delimiter</title>
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl <Location />
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl Substitute "s|<BR */?>|<br />|i"
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl </Location>
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl</directivesynopsis>
c3aaccf2d58cbd445efed832c4028787ac9f1542noodl</modulesynopsis>