Return-Path: Delivered-To: apmail-modperl-archive@apache.org Received: (qmail 75922 invoked by uid 500); 20 Feb 2002 13:02:47 -0000 Mailing-List: contact modperl-help@apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list modperl@apache.org Received: (qmail 75909 invoked from network); 20 Feb 2002 13:02:46 -0000 Message-ID: <3C739E6C.FD0AAC27@modperlcookbook.org> Date: Wed, 20 Feb 2002 08:02:36 -0500 From: Geoffrey Young X-Mailer: Mozilla 4.73 [en] (Windows NT 5.0; U) X-Accept-Language: en,pdf MIME-Version: 1.0 To: Cees Hek CC: John Stauffacher , modperl@apache.org Subject: Re: file globbing question References: <00be01c1b9b6$1fd51810$5a89d3ce@chapman.edu> <1014172838.24559.3.camel@cees> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Cees Hek wrote: > > On Wed, 2002-02-20 at 13:27, John Stauffacher wrote: > > All, > > > > I am a bit confused as to what httpd.conf directives need to be used in > > order to get apache to execute a PerlHandler when it encounters a > > certain file type. What I want to do: > > Execute a handler whenever a *.qw file is accessed. The same > > handler whether or not the file exists and not look for the file. So the > > user makes the request: get /somewhere/my.qw and gets the response > > "moo". Then they request /other/place/boo.qw and gets the response > > "moo". I have tried using a directive, but it envokes the > > handler, then looks for the file and throws a 404. Any ideas? > > The directive is the right way to go. Are you sure you are > returning OK in your Handler? If you return something else (like > DECLINED) then Apache will take over the request and handle it in the > default manner (ie look up the file). Returning OK lets Apache know > that the request was dealt with appropriately and it can move on to the > next phase. > another alternative is something like Apache::MIMEMapper... http://www.modperlcookbook.org/download/Apache-MIMEMapper-0.10.tar.gz which expands the AddHandler directive to make it a bit more mod_perl friendly. so, instead of using (which is perfectly legitimate) you can instead simply use AddHandler My::Module .qw and Apache will use My::Module::handler() for the content-generation phase. all the stuff Cees said it true, though - you still need to make sure your handler returns OK and follow the other handler rules. HTH --Geoff