FilesMatch for files that don't exist
I'd like to have a controller module, where any url that has a .phtml page will call the handler in the controller module. Within the controller module I use logic to determine which module (if any) should process the request using push_handlers. The issue is that I'm using virtual urls, so these .phtml files don't actually exist and FilesMatch wants a physical file on the server. I'm curious if my approach is the best way. httpd.conf -- PerlModule Apache::Controller Directory /usr/local/apache/htdocs SetHandler perl-script PerlHandler Apache::Controller /Directory Apache::Controller (simplified for clarity) --- package Apache::Controller; use strict; use Apache::Constants qw( :common ); sub handler { my $r = shift; my $cv; if( $r-uri =~ m{\.phtml$} ) { $cv = 'Apache::PHTML'; } else { return DECLINED; } OK; } 1; Now every request to apache will have to go through this handler...is this the best way to do this? Thanks. __ Terrorist Attacks on U.S. - How can you help? Donate cash, emergency relief information http://dailynews.yahoo.com/fc/US/Emergency_Information/
Re: FilesMatch for files that don't exist
Ooops, that should be: Apache::Controller (simplified for clarity) --- package Apache::Controller; use strict; use Apache::Constants qw( :common ); sub handler { my $r = shift; my $cv; if( $r-uri =~ m{\.phtml$} ) { $cv = 'Apache::PHTML'; } else { return DECLINED; } $r-push_handlers(PerlHandler = $cv); OK; } 1; __ Terrorist Attacks on U.S. - How can you help? Donate cash, emergency relief information http://dailynews.yahoo.com/fc/US/Emergency_Information/
Re: FilesMatch for files that don't exist
I'd like to have a controller module, where any url that has a .phtml page will call the handler in the controller module. Within the controller module I use logic to determine which module (if any) should process the request using push_handlers. The issue is that I'm using virtual urls, so these .phtml files don't actually exist and FilesMatch wants a physical file on the server. I'm curious if my approach is the best way. It's easier to use a directory structure, i.e. everything under /perl/ is handled by your controller module. You should also look at Apache::Dispatch. - Perrin
Re: FilesMatch for files that don't exist
--- Perrin Harkins [EMAIL PROTECTED] wrote: It's easier to use a directory structure, i.e. everything under /perl/ is handled by your controller module. You should also look at Apache::Dispatch. Thanks. Unfortunately I'm trying to please the designers and forcing them to put everything under a certain directory won't go :(. They're used to coldfusion/php, and I have to keep the structure of existing sites. They did go for another extension for the TT stuff though. I will check out Apache::Dispatch...thanks. __ Terrorist Attacks on U.S. - How can you help? Donate cash, emergency relief information http://dailynews.yahoo.com/fc/US/Emergency_Information/
Re: FilesMatch for files that don't exist
dss [EMAIL PROTECTED] said something to this effect on 09/17/2001: The issue is that I'm using virtual urls, so these .phtml files don't actually exist and FilesMatchwants a physical file on the server. I'm curious if my approach is the best way. Shouldn't LocationMatch be what you want? (darren) -- If it turns out that there is a God, I don't think that he's evil. But the worst that you can say about him is that basically he's an underachiever. -- Woody Allen