FilesMatch directive
authorAdam Chlipala <adamc@hcoop.net>
Tue, 15 Jul 2008 15:45:36 +0000 (15:45 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Tue, 15 Jul 2008 15:45:36 +0000 (15:45 +0000)
lib/apache.dtl
lib/mod_rewrite.dtl
src/plugins/apache.sml

index 483330f..8b7051c 100644 (file)
@@ -71,6 +71,12 @@ extern val directory : your_path -> ^Vhost & Location => [Vhost & !Location];
 {{Set some configuration specific to a URI prefix or filesystem directory,
   respectively.}}
 
 {{Set some configuration specific to a URI prefix or filesystem directory,
   respectively.}}
 
+extern type regexp;
+{{PCRE regular expression}}
+
+extern val filesMatch : regexp -> ^Vhost & Location => [Vhost & !Location];
+{{Mark nested configuration to only apply to filenames matching the regexp.}}
+
 extern val serverAliasHost : your_domain_host -> [Vhost];
 {{Give an alternate hostname for this vhost.}}
 extern val serverAlias : host -> [Vhost];
 extern val serverAliasHost : your_domain_host -> [Vhost];
 {{Give an alternate hostname for this vhost.}}
 extern val serverAlias : host -> [Vhost];
index 71ced0e..294033a 100644 (file)
@@ -46,9 +46,6 @@ extern type mod_rewrite_cond_flag;
 extern val cond_nocase : mod_rewrite_cond_flag;
 extern val ornext : mod_rewrite_cond_flag;
 
 extern val cond_nocase : mod_rewrite_cond_flag;
 extern val ornext : mod_rewrite_cond_flag;
 
-extern type regexp;
-{{PCRE regular expression}}
-
 extern val rewriteRule : regexp -> no_spaces -> [mod_rewrite_flag] -> [^Vhost];
 {{See <a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewriterule">Apache
   documentation for <tt>RewriteRule</tt></a>.}}
 extern val rewriteRule : regexp -> no_spaces -> [mod_rewrite_flag] -> [^Vhost];
 {{See <a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewriterule">Apache
   documentation for <tt>RewriteRule</tt></a>.}}
index ec41103..35d6cda 100644 (file)
@@ -594,6 +594,15 @@ val () = Env.container_one "directory"
                    inLocal := false;
                    localRewriteEnabled := false))
 
                    inLocal := false;
                    localRewriteEnabled := false))
 
+val () = Env.container_one "filesMatch"
+        ("regexp", Env.string)
+        (fn prefix =>
+            (write "\t<FilesMatch \"";
+             write prefix;
+             write "\">\n"),
+         fn () => (write "\t</FilesMatch>\n";
+                   localRewriteEnabled := false))
+
 fun checkRewrite () =
     if !inLocal then
        if !localRewriteEnabled then
 fun checkRewrite () =
     if !inLocal then
        if !localRewriteEnabled then