Received: (from majordom@localhost) by hyperreal.com (8.8.5/8.8.5) id EAA29796; Sun, 15 Jun 1997 04:23:26 -0700 (PDT) Received: from colin.muc.de (root@colin.muc.de [193.174.4.1]) by hyperreal.com (8.8.5/8.8.5) with SMTP id EAA29786 for ; Sun, 15 Jun 1997 04:23:14 -0700 (PDT) Received: from en by colin.muc.de with UUCP id <86063-2>; Sun, 15 Jun 1997 13:22:56 +0200 Received: by en1.engelschall.com (Sendmail 8.8.2) for new-httpd@hyperreal.com id NAA00387; Sun, 15 Jun 1997 13:19:14 +0200 (MET DST) Message-Id: <199706151119.NAA00387@en1.engelschall.com> Subject: [PATCH] mod_rewrite 3.0.5 -> 3.0.6 To: new-httpd@hyperreal.com (Apache Developer ML) Date: Sun, 15 Jun 1997 13:19:13 +0200 From: rse@engelschall.com (Ralf S. Engelschall) Organization: Engelschall, Germany. X-Home: http://www.engelschall.com/ X-Mailer: ELM [version 2.4ME+ PL32 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org A little maintainance patch which brings mod_rewrite from 3.0.5 to 3.0.6 - for inclusion in the patches-1.2 directory and Apache 1.2.1. Here is the snippet from the ChangeLog: ------ 970615 - added a new ruleflag (QSA=query_string_append) and changed the behaviour when a QUERY_STRING is generated (xxx?...): In the past mod_rewrite always _appended_ the existing QUERY_STRING to the generated one which caused _a lot of confusing_ for the users. Now the generated QUERY_STRING per default _REPLACES_ the existing one completely, except if the QSA flag is used. Now it acts the way the users always want to use it. - fixed a nasty bug in per-dir context: when a URL http://... was used in concunction with a special redirect flag, e.g. R=permanent, the permanent status was lost. [Thanks to Ronald Tschalaer for hint] - added Q.08 and Q.09 to the FAQ/documentation ------ The context diff is appended. Greetings, Ralf S. Engelschall rse@engelschall.com www.engelschall.com ======= *** mod_rewrite.c.old Fri Apr 25 01:35:22 1997 --- mod_rewrite.c Sun Jun 15 13:11:41 1997 *************** *** 61,67 **** ** |_| |_| |_|\___/ \__,_|___|_| \___| \_/\_/ |_| |_|\__\___| ** |_____| ** ! ** URL Rewriting Module, Version 3.0.5 (16-Apr-1997) ** ** This module uses a rule-based rewriting engine (based on a ** regular-expression parser) to rewrite requested URLs on the fly. --- 61,67 ---- ** |_| |_| |_|\___/ \__,_|___|_| \___| \_/\_/ |_| |_|\__\___| ** |_____| ** ! ** URL Rewriting Module, Version 3.0.6 (15-Jun-1997) ** ** This module uses a rule-based rewriting engine (based on a ** regular-expression parser) to rewrite requested URLs on the fly. *************** *** 779,784 **** --- 779,788 ---- || strcasecmp(key, "G") == 0 ) { cfg->flags |= RULEFLAG_GONE; } + else if ( strcasecmp(key, "qsappend") == 0 + || strcasecmp(key, "QSA") == 0 ) { + cfg->flags |= RULEFLAG_QSAPPEND; + } else { return pstrcat(p, "RewriteRule: unknown flag '", key, "'\n", NULL); } *************** *** 1559,1564 **** --- 1563,1569 ---- } rewritelog(r, 2, "[per-dir %s] redirect %s -> %s", perdir, r->filename, newuri); r->filename = pstrdup(r->pool, newuri); + r->status = p->forced_responsecode; return 1; } *************** *** 1602,1608 **** reduce_uri(r); /* split out on-the-fly generated QUERY_STRING '....?xxxxx&xxxx...' */ ! splitout_queryargs(r); /* if a MIME-type should be later forced for this URL, then remember this */ if (p->forced_mimetype != NULL) { --- 1607,1613 ---- reduce_uri(r); /* split out on-the-fly generated QUERY_STRING '....?xxxxx&xxxx...' */ ! splitout_queryargs(r, p->flags & RULEFLAG_QSAPPEND); /* if a MIME-type should be later forced for this URL, then remember this */ if (p->forced_mimetype != NULL) { *************** *** 1788,1794 **** ** */ ! static void splitout_queryargs(request_rec *r) { char *q; char *olduri; --- 1793,1799 ---- ** */ ! static void splitout_queryargs(request_rec *r, int qsappend) { char *q; char *olduri; *************** *** 1797,1803 **** if (q != NULL) { olduri = pstrdup(r->pool, r->filename); *q++ = '\0'; ! r->args = pstrcat(r->pool, q, "&", r->args, NULL); if (r->args[strlen(r->args)-1] == '&') r->args[strlen(r->args)-1] = '\0'; rewritelog(r, 3, "split uri=%s -> uri=%s, args=%s", olduri, r->filename, r->args); --- 1802,1811 ---- if (q != NULL) { olduri = pstrdup(r->pool, r->filename); *q++ = '\0'; ! if (qsappend) ! r->args = pstrcat(r->pool, q, "&", r->args, NULL); ! else ! r->args = pstrdup(r->pool, q); if (r->args[strlen(r->args)-1] == '&') r->args[strlen(r->args)-1] = '\0'; rewritelog(r, 3, "split uri=%s -> uri=%s, args=%s", olduri, r->filename, r->args); *** mod_rewrite.h.old Thu Apr 17 04:52:51 1997 --- mod_rewrite.h Sun Jun 15 10:36:00 1997 *************** *** 64,70 **** ** |_| |_| |_|\___/ \__,_|___|_| \___| \_/\_/ |_| |_|\__\___| ** |_____| ** ! ** URL Rewriting Module, Version 3.0.5 (16-Apr-1997) ** ** This module uses a rule-based rewriting engine (based on a ** regular-expression parser) to rewrite requested URLs on the fly. --- 64,70 ---- ** |_| |_| |_|\___/ \__,_|___|_| \___| \_/\_/ |_| |_|\__\___| ** |_____| ** ! ** URL Rewriting Module, Version 3.0.6 (15-Jun-1997) ** ** This module uses a rule-based rewriting engine (based on a ** regular-expression parser) to rewrite requested URLs on the fly. *************** *** 171,176 **** --- 171,177 ---- #define RULEFLAG_PASSTHROUGH 1<<8 #define RULEFLAG_FORBIDDEN 1<<9 #define RULEFLAG_GONE 1<<10 + #define RULEFLAG_QSAPPEND 1<<11 #define MAPTYPE_TXT 1<<0 #define MAPTYPE_DBM 1<<1 *************** *** 334,340 **** static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p, char *perdir); /* URI transformation function */ ! static void splitout_queryargs(request_rec *r); static void reduce_uri(request_rec *r); static char *expand_tildepaths(request_rec *r, char *uri); static void expand_map_lookups(request_rec *r, char *uri, int uri_len); --- 335,341 ---- static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p, char *perdir); /* URI transformation function */ ! static void splitout_queryargs(request_rec *r, int qsappend); static void reduce_uri(request_rec *r); static char *expand_tildepaths(request_rec *r, char *uri); static void expand_map_lookups(request_rec *r, char *uri, int uri_len);