The
The meaning of the pattern can be modified by using any combination of these flags:
i
n
n
flag forces the pattern to be treated
as a fixed string.f
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. This is the default.q
q
flag causes mod_substitute
to not
flatten the buckets after each substitution. This can
result in much faster response and a decrease in memory
utilization, but should only be used if there is no possibility
that the result of one substitution will ever match a pattern
or regex of a subsequent one.The substitution is may contain literal text and regular expression backreferences
The character which is used to separate (or "delimit") the various parts of the substituion string is referred to as the "delimiter", and it is most common to use a slash for this purpose.
If either the pattern or the substitution contain a slash character then an alternative delimiter may be used to make the directive more readable:
Backreferences can be used in the comparison and in the substitution, when regular expressions are used, as illustrated in the following example:
A common use scenario for mod_substitute
is the
situation in which a front-end server proxies requests to a back-end
server which returns HTML with hard-coded embedded URLs that refer
to the back-end server. These URLs don't work for the end-user,
since the back-end server is unreachable.
In this case, mod_substitute
can be used to rewrite
those URLs into something that will work from the front end:
Location
(redirect) headers that are sent
by the back-end server, and, in this example,
The maximum line size handled by b
, B
, k
,
K
, m
, M
, g
,
G
to provide the size in bytes, kilobytes, megabytes
or gigabytes respectively.
Whether to apply the inherited on
), or after the ones of the current
context (off
).