* mod_rewrite: PR53963: Ad an opt-in RewriteOption to control merging of RewriteBase
(This merge started happening in 2.4.0/2.2.23)
Submitted by: covener
Reviewed by: covener, minfrin, sf
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1418954 13f79535-47bb-0310-9956-
ffa450edef68
Changes with Apache 2.4.4
+ *) mod_rewrite: Stop mergeing RewriteBase down to subdirectories
+ unless new option 'RewriteOptions MergeBase' is configured.
+ PR 53963. [Eric Covener]
+
*) mod_status, mod_info, mod_proxy_ftp, mod_proxy_balancer, mod_imagemap,
mod_ldap: Improve escaping of hostname and URIs HTML output.
[Jim Jagielski, Stefan Fritsch]
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * mod_rewrite: PR53963: Ad an opt-in RewriteOption to control merging of RewriteBase
- (This merge started happening in 2.4.3/2.2.23)
- trunk patch: http://svn.apache.org/viewvc?rev=1410681&view=rev
- 2.4.x patch: http://people.apache.org/~covener/patches/httpd-2.4.x-rewritebase_optional.diff
- +1 covener, minfrin, sf
-
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
</note>
</dd>
+ <dt><code>MergeBase</code></dt>
+ <dd>
+
+ <p>With this option, the value of <directive module="mod_rewrite"
+ >RewriteBase</directive> is copied from where it's explicitly defined
+ into any sub-directory or sub-location that doesn't define its own
+ <directive module="mod_rewrite">RewriteBase</directive>. This was the
+ default behavior in 2.4.0 thorugh 2.4.3, and the flag to restore it is
+ available Apache HTTP Server 2.4.4 and later.</p>
+ </dd>
</dl>
</usage>
#define OPTION_INHERIT_BEFORE 1<<2
#define OPTION_NOSLASH 1<<3
#define OPTION_ANYURI 1<<4
+#define OPTION_MERGEBASE 1<<5
#ifndef RAND_MAX
#define RAND_MAX 32767
a->state_set = overrides->state_set || base->state_set;
a->options = (overrides->options_set == 0) ? base->options : overrides->options;
a->options_set = overrides->options_set || base->options_set;
- a->baseurl = (overrides->baseurl_set == 0) ? base->baseurl : overrides->baseurl;
- a->baseurl_set = overrides->baseurl_set || base->baseurl_set;
+
+ if (a->options & OPTION_MERGEBASE) {
+ a->baseurl = (overrides->baseurl_set == 0) ? base->baseurl : overrides->baseurl;
+ a->baseurl_set = overrides->baseurl_set || base->baseurl_set;
+ }
a->directory = overrides->directory;
else if (!strcasecmp(w, "allowanyuri")) {
options |= OPTION_ANYURI;
}
+ else if (!strcasecmp(w, "mergebase")) {
+ options |= OPTION_MERGEBASE;
+ }
else {
return apr_pstrcat(cmd->pool, "RewriteOptions: unknown option '",
w, "'", NULL);