Blame SOURCES/httpd-2.4.6-rewrite-dir.patch

008793
Index: modules/mappers/mod_rewrite.h
008793
===================================================================
008793
--- a/modules/mappers/mod_rewrite.h	(revision 1560696)
008793
+++ b/modules/mappers/mod_rewrite.h	(revision 1560697)
008793
@@ -29,6 +29,8 @@
008793
 #include "apr_optional.h"
008793
 #include "httpd.h"
008793
 
008793
+#define REWRITE_REDIRECT_HANDLER_NAME "redirect-handler"
008793
+
008793
 /* rewrite map function prototype */
008793
 typedef char *(rewrite_mapfunc_t)(request_rec *r, char *key);
008793
 
008793
Index: modules/mappers/mod_dir.c
008793
===================================================================
008793
--- a/modules/mappers/mod_dir.c	(revision 1560696)
008793
+++ b/modules/mappers/mod_dir.c	(revision 1560697)
008793
@@ -29,6 +29,7 @@
008793
 #include "http_log.h"
008793
 #include "http_main.h"
008793
 #include "util_script.h"
008793
+#include "mod_rewrite.h"
008793
 
008793
 module AP_MODULE_DECLARE_DATA dir_module;
008793
 
008793
@@ -260,6 +261,11 @@
008793
         return HTTP_MOVED_PERMANENTLY;
008793
     }
008793
 
008793
+    /* we're running between mod_rewrites fixup and its internal redirect handler, step aside */
008793
+    if (!strcmp(r->handler, REWRITE_REDIRECT_HANDLER_NAME)) { 
008793
+        return DECLINED;
008793
+    }
008793
+
008793
     if (d->index_names) {
008793
         names_ptr = (char **)d->index_names->elts;
008793
         num_names = d->index_names->nelts;
008793
Index: modules/mappers/mod_rewrite.c
008793
===================================================================
008793
--- a/modules/mappers/mod_rewrite.c	(revision 1560696)
008793
+++ b/modules/mappers/mod_rewrite.c	(revision 1560697)
008793
@@ -5004,7 +5004,7 @@
008793
             rewritelog((r, 1, dconf->directory, "internal redirect with %s "
008793
                         "[INTERNAL REDIRECT]", r->filename));
008793
             r->filename = apr_pstrcat(r->pool, "redirect:", r->filename, NULL);
008793
-            r->handler = "redirect-handler";
008793
+            r->handler = REWRITE_REDIRECT_HANDLER_NAME;
008793
             return OK;
008793
         }
008793
     }
008793
@@ -5050,7 +5050,7 @@
008793
  */
008793
 static int handler_redirect(request_rec *r)
008793
 {
008793
-    if (strcmp(r->handler, "redirect-handler")) {
008793
+    if (strcmp(r->handler, REWRITE_REDIRECT_HANDLER_NAME)) {
008793
         return DECLINED;
008793
     }
008793