cgiapp:
I wrote:
> Perhaps a rewrite is what I need.
Adding the following to .htaccess appears to attain the goal:
RewriteEngine On
RewriteRule !^index\.pl.* index.pl/$0
I also added a dump of %ENV to the default run mode to see what's going on. It
looks like I can get the original URI via $ENV{'REQUEST_URI'}. If the rewrite
rule fires, it sets $ENV{'REDIRECT_STATUS'} and $ENV{'REDIRECT_URL'}.
Please let me know if anyone sees any problems.
I've added the "Free software/Perl" license to all files and reposted, below.
Thanks all! :-)
David
[EMAIL PROTECTED]:~$ cat hdwf/conf/vhost.conf
# $Id: vhost.conf,v 1.3 2005/11/29 05:17:03 dpchrist Exp $
#
# Apache configuration settings for hdwf.holgerdanske.com.
#
# Copyright 2005 by David Christensen <[EMAIL PROTECTED]>
#
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
<VirtualHost 192.168.254.22>
ServerName hdwf.holgerdanske.com
ServerAdmin [EMAIL PROTECTED]
DocumentRoot /home/dpchrist/hdwf/htdocs
HostnameLookups off
UserDir disabled
Alias /images/ /home/dpchrist/hdwf/images/
</VirtualHost>
<Directory /home/dpchrist/hdwf/htdocs>
AllowOverride All
</Directory>
[EMAIL PROTECTED]:~$ cat hdwf/htdocs/.htaccess
# $Id: .htaccess,v 1.8 2005/11/29 05:17:03 dpchrist Exp $
#
# Apache configuration settings for hdwf.holgerdanske.com
#
# Copyright 2005 by David Christensen <[EMAIL PROTECTED]>
#
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
DirectoryIndex index.pl
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
PerlSendHeader On
RewriteEngine On
RewriteRule !^index\.pl.* index.pl/$0
[EMAIL PROTECTED]:~$ cat hdwf/htdocs/index.pl
#! /usr/bin/perl
#######################################################################
# $Id: index.pl,v 1.3 2005/11/29 05:17:03 dpchrist Exp $
#
# Perl instance script for hdwf.holgerdanske.com.
#
# Copyright 2005 by David Christensen <[EMAIL PROTECTED]>
#
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#######################################################################
use strict;
use warnings;
use CGI::Carp qw(fatalsToBrowser);
use FindBin qw( $Bin );
use lib "$Bin/../modules";
use Hdwf;
my $app = Hdwf->new();
$app->run();
#######################################################################
[EMAIL PROTECTED]:~$ cat hdwf/modules/Hdwf.pm
#######################################################################
# $Id: Hdwf.pm,v 1.10 2005/11/29 05:17:03 dpchrist Exp $
#
# hdwf.holgerdanske.com CGI::Application module.
#
# Copyright 2005 by David Christensen <[EMAIL PROTECTED]>
#
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#######################################################################
# uses:
#----------------------------------------------------------------------
use warnings;
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use Data::Dumper;
$Data::Dumper::Sortkeys = 1;
package Hdwf;
use base 'CGI::Application';
#######################################################################
# overloaded CGI::Application methods:
#----------------------------------------------------------------------
sub setup {
my $self = shift;
$self->start_mode('home');
$self->mode_param('rm');
$self->run_modes(
'home' => 'home',
);
}
#######################################################################
# run modes:
#----------------------------------------------------------------------
sub home {
return
"hello, world!" .
CGI::pre(Data::Dumper->Dump([\%ENV], [qw(*ENV)]));
}
#######################################################################
# end of module:
#----------------------------------------------------------------------
1;
__END__
#######################################################################
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]