httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Akins <brian.ak...@turner.com>
Subject [PATCH] add notfound to mod_rewrite rule
Date Thu, 01 Jun 2006 19:36:40 GMT
patch against 2.2.2 (but should work on most other versions).  Adds the 
"notfound" (NF) flag to rewriterule that will case it to return 
HTTP_NOT_FOUND for matched, similar to the gone and forbidden options.



--- mod_rewrite.c.bak   2006-06-01 15:25:48.000000000 -0400
+++ mod_rewrite.c       2006-06-01 15:29:18.000000000 -0400
@@ -3264,6 +3264,11 @@
              || !strcasecmp(key, "ocase")) {                /* nocase */
              cfg->flags |= RULEFLAG_NOCASE;
          }
+        else if (((*key == 'F' || *key == 'f') && !key[1])
+             || !strcasecmp(key, "otfound")) {           /* notfound */
+            cfg->flags |= (RULEFLAG_STATUS | RULEFLAG_NOSUB);
+            cfg->forced_responsecode = HTTP_NOT_FOUND;
+        }
          else {
              ++error;
          }


-- 
Brian Akins
Lead Systems Engineer
CNN Internet Technologies

Mime
View raw message