Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 29799 invoked from network); 7 Mar 2007 17:47:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Mar 2007 17:47:49 -0000 Received: (qmail 34048 invoked by uid 500); 7 Mar 2007 17:47:48 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 33709 invoked by uid 500); 7 Mar 2007 17:47:47 -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 33698 invoked by uid 99); 7 Mar 2007 17:47:47 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Mar 2007 09:47:47 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of matt.farey@gmail.com designates 66.249.92.175 as permitted sender) Received: from [66.249.92.175] (HELO ug-out-1314.google.com) (66.249.92.175) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Mar 2007 09:47:35 -0800 Received: by ug-out-1314.google.com with SMTP id 75so629466ugb for ; Wed, 07 Mar 2007 09:47:14 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:x-enigmail-version:content-type:content-transfer-encoding; b=riFxodEQ+d7t/U5Lo8iriZfBz6900FS7OmfkV+wgqypBPy6GGaJwtyC/58zXgUEnUlWagDNsnrCxqPWhMiKo9xXUZxOl9oq1pYdYzqgrhKcrKARMY1SDWzogfGMXBgwT4I3spXuJGvT9aIpQ3E+xQLki+T5AfGky9Usa11pLpm8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:x-enigmail-version:content-type:content-transfer-encoding; b=LCzbpx1OwMw2HqpCHSP9iaRci9DVliLzH7lwMddpcIJW9EKZLLWlUZV6K80Ponm3cRgzZRlVsfNjFXXTNI6/QoykelUaxOxG5ZfyPC0wK6KDClu66ijm+bdscBssxxoKIa9TpON5XeJkOzMRu6WLS1dUhI2Nj5yUj9f0sl2sRrA= Received: by 10.66.250.17 with SMTP id x17mr4775963ugh.1173289634394; Wed, 07 Mar 2007 09:47:14 -0800 (PST) Received: from ?192.168.0.5? ( [82.69.105.150]) by mx.google.com with ESMTP id p32sm1800468ugc.2007.03.07.09.47.13; Wed, 07 Mar 2007 09:47:13 -0800 (PST) Message-ID: <45EEFA99.7010806@gmail.com> Date: Wed, 07 Mar 2007 17:47:05 +0000 From: matt farey User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: users@httpd.apache.org References: <45EF3FB0.5090703@gmail.com> In-Reply-To: <45EF3FB0.5090703@gmail.com> X-Enigmail-Version: 0.94.2.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] Render an image for a 404 on images philguillard wrote: > Hi, > > Thank you guys. > Unfortunately i didn't succed with the Directory directive soluion > because of some other rewrite rules. > But with mod rewrite i succeded doing this: > > RewriteCond %{REQUEST_URI} /img/folder/(.*)\.jpg$ > RewriteCond /usr/local/apache2/htdocs/%{REQUEST_URI} !-f > RewriteRule ^(.+) /img/folder/no.gif > you can modify this if you want to make sure you always serve the 404 image with the same mimetype as the failed image. RewriteCond %{REQUEST_URI} \.(jpg|jpeg|gif|png)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule .* /img/folder/no.%1 > > Regards, > > Phil > > > > why not have a rewrite that says if the request is an image, and is not > present, then redirect to the 404 images, you can capture the type of > extension in the rewrite and direct to the appropriate pre-rendered > image. > > philguillard wrote: > > >> Hi, > >> > >> I'd like to render a specific 404.gif file when the requested > >> gif/png/jpg image is not found on the file system while other > >> documents are still redirected to a 404.html document with > >> "ErrorDocument 504 /404.html" directive. > >> > >> Is there a way to do that in http.conf? I can do it within my > >> application (i use tomcat) but i think it is bad idea for performance > >> reasons. > >> > >> Regards, > >> > >> Phil > >> > >> --------------------------------------------------------------------- > >> 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 > >> > >> > > > -- Matthew Farey Web App Sec. 25 The Polygon, Southampton, Hants, SO15 > 2BP, UK Phone +44(0)2380 631449 > > --------------------------------------------------------------------- > 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 > > -- Matthew Farey --------------------------------------------------------------------- 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