Ouch. Please add a rule flag, that enables this behaviour, if you really need that. mod_rewrite already has enough fancy magic. (and rewriting in directory context to a resource named "-" is perfectly valid)
nd * [email protected] wrote: > Author: covener > Date: Thu Feb 2 15:43:41 2012 > New Revision: 1239679 > > URL: http://svn.apache.org/viewvc?rev=1239679&view=rev > Log: > treat a rewriterule substitution that expands to "-" as if the rule > had a literal "-". > > Modified: > httpd/httpd/trunk/CHANGES > httpd/httpd/trunk/modules/mappers/mod_rewrite.c > > Modified: httpd/httpd/trunk/CHANGES > URL: > http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1239679&r1=123 >9678&r2=1239679&view=diff > ========================================================================= >===== --- httpd/httpd/trunk/CHANGES [utf-8] (original) > +++ httpd/httpd/trunk/CHANGES [utf-8] Thu Feb 2 15:43:41 2012 > @@ -1,6 +1,10 @@ > -*- coding: > utf-8 -*- Changes with Apache 2.5.0 > > + *) mod_rewrite: Treat a RewriteRule substitution that expands to > + "-" to behave as if a literal "-" was used in the RewriteRule > + (no substitution). [Eric Covener] > + > *) mod_authnz_ldap: Don't try a potentially expensive nested groups > search before exhausting all AuthLDAPGroupAttribute checks on the > current group. PR52464 [Eric Covener] > > Modified: httpd/httpd/trunk/modules/mappers/mod_rewrite.c > URL: > http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_rewrit >e.c?rev=1239679&r1=1239678&r2=1239679&view=diff > ========================================================================= >===== --- httpd/httpd/trunk/modules/mappers/mod_rewrite.c (original) > +++ httpd/httpd/trunk/modules/mappers/mod_rewrite.c Thu Feb 2 15:43:41 > 2012 @@ -3909,6 +3909,7 @@ static int apply_rewrite_rule(rewriterul > char *newuri = NULL; > request_rec *r = ctx->r; > int is_proxyreq = 0; > + int force_no_sub = 0; > > ctx->uri = r->filename; > > @@ -4022,6 +4023,11 @@ static int apply_rewrite_rule(rewriterul > newuri = do_expand(p->output, ctx, p); > rewritelog((r, 2, ctx->perdir, "rewrite '%s' -> '%s'", ctx->uri, > newuri)); > + /* Allow a substitution to resolve to "-" and act like a literal > "-" */ + if (newuri && *newuri == '-' && !newuri[1]) { > + newuri = NULL; > + force_no_sub = 1; > + } > } > > /* expand [E=var:val] and [CO=<cookie>] */ > @@ -4029,7 +4035,7 @@ static int apply_rewrite_rule(rewriterul > do_expand_cookie(p->cookie, ctx); > > /* non-substitution rules ('RewriteRule <pat> -') end here. */ > - if (p->flags & RULEFLAG_NOSUB) { > + if (p->flags & RULEFLAG_NOSUB || force_no_sub) { > force_type_handler(p, ctx); > > if (p->flags & RULEFLAG_STATUS) { -- Da fällt mir ein, wieso gibt es eigentlich in Unicode kein "i" mit einem Herzchen als Tüpfelchen? Das wär sooo süüss! -- Björn Höhrmann in darw
