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/