Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 22452 invoked from network); 8 May 2009 18:52:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 May 2009 18:52:07 -0000 Received: (qmail 90290 invoked by uid 500); 8 May 2009 18:52:03 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 90257 invoked by uid 500); 8 May 2009 18:52:02 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 90248 invoked by uid 99); 8 May 2009 18:52:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 May 2009 18:52:02 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [80.229.52.226] (HELO opensolaris.local) (80.229.52.226) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 May 2009 18:51:53 +0000 Received: from [127.0.0.1] (opensolaris.local [127.0.0.1]) by opensolaris.local (8.14.3+Sun/8.14.3) with ESMTP id n48IqBJD001072 for ; Fri, 8 May 2009 19:52:11 +0100 (BST) Message-ID: <4A047F5B.8080801@webthing.com> Date: Fri, 08 May 2009 19:52:11 +0100 From: Nick Kew User-Agent: Thunderbird 2.0.0.17 (X11/20081023) MIME-Version: 1.0 To: users@httpd.apache.org References: <4A046F42.60508@walterisookeensufferukker.nl> In-Reply-To: <4A046F42.60508@walterisookeensufferukker.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] restrict virtualhost to certain type of files Davide Bianchi wrote: > jeremy co wrote: >> restrict virtual host to serve only files with the extensions html, jpg, >> and png. and also generate custom error msg if client request other type >> of files Use to scope a restriction, and ErrorDocument. > I'd do something like: > > RewriteCond %{REQUEST_URI} !.*\.html$ > RewriteCond %{REQUEST_URI} !.*\.jpg$ > RewriteCond %{REQUEST_URI} !.*\.png$ > RewriteRule ^/(.*)$ /error.html [P,NE,L] Over-complicated (looks wrong to me with that P), and won't send an HTTP error even if correct. -- Nick Kew --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org