]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Update mod_rewrite from 3.0.5 to 3.0.6.
authordgaudet <dgaudet@unknown>
Fri, 27 Jun 1997 02:26:32 +0000 (02:26 +0000)
committerdgaudet <dgaudet@unknown>
Fri, 27 Jun 1997 02:26:32 +0000 (02:26 +0000)
Reviewed by: Dean, Alexei
Submitted by: Ralf
Obtained from:

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3@78388 13f79535-47bb-0310-9956-ffa450edef68

APACHE_1_2_X/src/CHANGES
APACHE_1_2_X/src/modules/standard/mod_rewrite.c
APACHE_1_2_X/src/modules/standard/mod_rewrite.h

index 4064a70e00979dae0c220c3dffe1a341e70109d5..354a49365ba50157c56f2a1293df73c4ced45de1 100644 (file)
@@ -1,5 +1,11 @@
 Changes with Apache 1.2.1
-  
+
+  *) Update mod_rewrite from 3.0.5 to 3.0.6.  New ruleflag
+     QSA=query_string_append.  Also 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.
+     [Ronald Tschalaer <Ronald.Tschalaer@psi.ch>, Ralf S. Engelschall]
+
   *) If an object has multiple variants that are otherwise equal Apache
      would prefer the last listed variant rather than the first.
      [Paul Sutton] PR#94
index cb14372f98e5937051c46d6b53c71b3b6be410cc..471359a07e5ce7cc21e6deeda0873ca1348bbd63 100644 (file)
@@ -61,7 +61,7 @@
 **  |_| |_| |_|\___/ \__,_|___|_|  \___| \_/\_/ |_|  |_|\__\___|
 **                       |_____|
 **
-**  URL Rewriting Module, Version 3.0.5 (16-Apr-1997)
+**  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,6 +779,10 @@ static const char *cmd_rewriterule_setflag(pool *p, rewriterule_entry *cfg, char
              || 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,6 +1563,7 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p, char *perdir
             }
             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,7 +1607,7 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p, char *perdir
         reduce_uri(r);
 
         /* split out on-the-fly generated QUERY_STRING '....?xxxxx&xxxx...' */
-        splitout_queryargs(r);
+        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,7 +1793,7 @@ static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p, char *perdir
 **
 */
 
-static void splitout_queryargs(request_rec *r)
+static void splitout_queryargs(request_rec *r, int qsappend)
 {
     char *q;
     char *olduri;
@@ -1797,7 +1802,10 @@ static void splitout_queryargs(request_rec *r)
     if (q != NULL) {
         olduri = pstrdup(r->pool, r->filename);
         *q++ = '\0';
-        r->args = pstrcat(r->pool, q, "&", r->args, NULL);
+        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);
index c8bec8b537a65abc745e40b9262e378f327ada36..b1a90a385734d40b1f596816e8d27fc6fb313c84 100644 (file)
@@ -64,7 +64,7 @@
 **  |_| |_| |_|\___/ \__,_|___|_|  \___| \_/\_/ |_|  |_|\__\___|
 **                       |_____|
 **
-**  URL Rewriting Module, Version 3.0.5 (16-Apr-1997)
+**  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. 
 #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,7 +335,7 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p, char *perdir
 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  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);