@@ -153,7 +153,7 @@ characters rejected when they are copied into the query string unencoded.
153153RewriteRule "^search/(.*)$" "/search.php/$1" "[BCTLS]"
154154</highlight >
155155
156- <p >This flag is available in version 2.4.57 and later.</p >
156+ <p >This flag is available in version 2.5.1 and later.</p >
157157
158158</section >
159159
@@ -168,7 +168,7 @@ escaped.
168168RewriteRule "^search/(.*)$" "/search.php?term=$1" "[B,BNE=/]"
169169</highlight >
170170
171- <p >This flag is available in version 2.4.57 and later.</p >
171+ <p >This flag is available in version 2.5.1 and later.</p >
172172</section >
173173
174174<section id =" flag_c" ><title >C|chain</title >
@@ -223,6 +223,7 @@ security model.</dd>
223223<dd >A value of 0 indicates that the cookie will persist only for the
224224current browser session. This is the default value if none is
225225specified.</dd >
226+ <dd >A negative value causes the cookie to be unset in the browser.</dd >
226227
227228<dt >Path</dt >
228229<dd >The path, on the current website, for which the cookie is valid,
@@ -244,7 +245,7 @@ browsers that support this feature.</dd>
244245<dt >samesite</dt >
245246<dd >If set to anything other than <code >false</code > or <code >0</code >, the <code >SameSite</code >
246247attribute is set to the specified value. Typical values are <code >None</code >,
247- <code >Lax</code >, and <code >Strict</code >. Available in 2.4.47 and later.</dd >
248+ <code >Lax</code >, and <code >Strict</code >. Available in 2.5.1 and later.</dd >
248249</dl >
249250
250251
@@ -346,6 +347,33 @@ CustomLog "logs/access_log" combined env=!image
346347<p >Note that this same effect can be obtained using <directive
347348module=" mod_setenvif" >SetEnvIf</directive >. This technique is offered as
348349an example, not as a recommendation.</p >
350+
351+ <p ><strong >Setting environment variables for tracking rewrites</strong ></p >
352+
353+ <p >At times, we want to maintain some kind of status when we
354+ perform a rewrite. For example, you want to make a note that
355+ you've done that rewrite, so that you can check later to see if a
356+ request came via that rewrite. One way to do this is by setting an
357+ environment variable.</p >
358+
359+ <highlight language =" config" >
360+ RewriteEngine on
361+ RewriteRule "^/horse/(.*)" "/pony/$1" [E=<strong >rewritten:1</strong >]
362+ </highlight >
363+
364+ <p >Later in your ruleset you might check for this environment
365+ variable using a RewriteCond:</p >
366+
367+ <highlight language =" config" >
368+ RewriteCond "%{ENV:rewritten}" =1
369+ </highlight >
370+
371+ <p >Note that environment variables do not survive an external
372+ redirect. You might consider using the [CO] flag to set a
373+ cookie. For per-directory and htaccess rewrites, where the final
374+ substitution is processed as an internal redirect, environment
375+ variables from the previous round of rewriting are prefixed with
376+ "REDIRECT_". </p >
349377</section >
350378
351379<section id =" flag_end" ><title >END</title >
@@ -495,7 +523,7 @@ pattern still matches (i.e., while the URI still contains an
495523<code >A</code >), perform this substitution (i.e., replace the
496524<code >A</code > with a <code >B</code >).</p >
497525
498- <p >In 2.4.8 and later, this module returns an error after 10,000 iterations to
526+ <p >In 2.5.0 and later, this module returns an error after 10,000 iterations to
499527protect against unintended looping. An alternative maximum number of
500528iterations can be specified by adding to the N flag. </p >
501529<highlight language =" config" >
@@ -885,14 +913,14 @@ The <code>L</code> flag can be useful in this context to end the
885913 This protects from a malicious URL causing the expanded substitution to
886914 map to an unexpected filesystem location.</p >
887915
888- <p ><since >2.4.60 </since ></p >
916+ <p ><since >2.5.1 </since ></p >
889917</section >
890918<section id =" flag_unc" ><title >UNC</title >
891919 <p > Setting this flag prevents the merging of multiple leading slashes,
892920 as used in Windows UNC paths. The flag is not necessary when the rules
893921 substitution starts with multiple literal slashes.</p >
894922
895- <p ><since >2.4.62 </since ></p >
923+ <p ><since >2.5.1 </since ></p >
896924</section >
897925
898926</manualpage >
0 commit comments