The following reply was made to PR general/2651; it has been noted by GNATS.

From: "Ralf S. Engelschall" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: general/2651: Feature Request: Allow content-negotiation through 
on-the-fly Actions
Date: Wed, 22 Jul 1998 13:38:29 +0200

 In article <[EMAIL PROTECTED]> you wrote:
 
 >[...]
 >>Synopsis:       Feature Request: Allow content-negotiation through 
 >>on-the-fly Actions
 >[...]
 >>Description:
 > I would like to provide on-the-fly compression and tar files through Apache.
 > e.g. a request for release.tar.gz compresses release.tar
 
 > Currently if the file does not exist, the custom Action is not called. The 
 > compression can be done through the ErrorDocument, but the error code is sent
 > already and this solution seems inelegant to me.
 >>How-To-Repeat:
 
 >>Fix:
 > Add a new directive: Generate: <mime-type> <script> which will call the 
 > script.
 > The script can either send an existing file or provide some sort of 
 > automatic 
 > generation. In addition to the obvious compression and archiving ability, 
 > simple
 > content-negotiation could be used.
 
 IMHO its not really necessary to create another directive because this
 functionality already can be achieved by existing methods. One is to use a
 RewriteRule to map certain extensions on URLs to your on-the-fly filters. For
 instance when you have written a /path/to/bin/filter-gzip.cgi which reads the
 file via PATH_TRANSLATED and outputs an "octet-stream"-declared gzip'ed
 version of it, you simply can activate it for (perhaps) tar.gz and ps.gz files
 as following:
 
   RewriteEngine on
   RewriteRule   ^/(.+\.(tar|ps))\.gz$ \
                 /path/to/bin/filter-gzip.cgi/$1 \
                 [T=application/x-httpd-cgi]
 
 This rule should do the trick for you, even I've not tried it out myself.
 
 Greetings,
                                        Ralf S. Engelschall
                                        [EMAIL PROTECTED]
                                        www.engelschall.com

Reply via email to