From 767fe69579cd02e13f88b59a94522a9d9b298f1b Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 15 Jul 2008 15:45:36 +0000 Subject: [PATCH] FilesMatch directive --- lib/apache.dtl | 6 ++++++ lib/mod_rewrite.dtl | 3 --- src/plugins/apache.sml | 9 +++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/apache.dtl b/lib/apache.dtl index 483330f..8b7051c 100644 --- a/lib/apache.dtl +++ b/lib/apache.dtl @@ -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.}} +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]; diff --git a/lib/mod_rewrite.dtl b/lib/mod_rewrite.dtl index 71ced0e..294033a 100644 --- a/lib/mod_rewrite.dtl +++ b/lib/mod_rewrite.dtl @@ -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 type regexp; -{{PCRE regular expression}} - extern val rewriteRule : regexp -> no_spaces -> [mod_rewrite_flag] -> [^Vhost]; {{See Apache documentation for RewriteRule.}} diff --git a/src/plugins/apache.sml b/src/plugins/apache.sml index ec41103..35d6cda 100644 --- a/src/plugins/apache.sml +++ b/src/plugins/apache.sml @@ -594,6 +594,15 @@ val () = Env.container_one "directory" inLocal := false; localRewriteEnabled := false)) +val () = Env.container_one "filesMatch" + ("regexp", Env.string) + (fn prefix => + (write "\t\n"), + fn () => (write "\t\n"; + localRewriteEnabled := false)) + fun checkRewrite () = if !inLocal then if !localRewriteEnabled then -- 2.20.1