User NICKNick Tonkin wrote:
Hi all,
For some months I have been using TT2 to serve some of my websites.
Following the tutorial at
http://www.template-toolkit.org/docs/plain/Tutorial/Web.html#DYNAMIC_CONTENT_GENERATION_VIA_APACHE_MOD_PERL_HANDLER
I have always used the following to determine the template to be
processed:
my $uri = $r->parsed_uri;
my $path = $uri->path;
$path =~ s[^/][];
$template->process($path) || return fail($r, SERVER_ERROR, $template->error());
Recently I upgraded my installation to Apache 2/mod_perl2. Since then my
configuration breaks when the client requests a URI ending in a directory:
[Sun Feb 16 22:32:34 2003] [error] file error - weather/buoys/: not found [/home/www/ladyraquel/weather/buoys/index.html]
It's not clear from your report what has changed. Do you get different values
for $r->parsed_uri->path and $r->uri? Can you give an example of the URL you
have the problem with?
So I changed my handler to say:
my $uri = $r->uri;
$uri =~ s[^/][];
$template->process($uri) ....
This works as I would have expected. But I am confused:
o Why does the example call for $r->parsed_uri->path in the first place?
o What about moving to Apache2 would have caused the behavior to differ?
o Any Bad Part about using $r->uri as I have now?
Thanks,
Nick
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates