Apache/1.3.26 + mod_perl/1.27

I've noticed that Apache alone appears to differ from one of my modules
running under mod_perl in its handling of trailing slashes. I'm wondering if
this is expected behavior and, if so, why? (Maybe this is obvious...)

For example: the file "news.html" exists in "/var/www/html/". I issue four
requests to Apache alone, one for "/news.html", one for "/news", one for
"/news/" and one for "/news.html/", and then the same four requests again,
this time under mod_perl.

The second time, under mod_perl, I use a basic little module that simply
records the value of $r->filename to the error log and then sends the
contents of the file to the browser (after opening it with Apache::File,
similar to the Ch. 4 Eagle book instructions). (No directory called
"/var/www/html//news" exists, nor are there any symlinks involved.)

Here's a table of the results:

Apache
-------
/news.html      /news   /news/  /news.html/
200             200     404     404

200 means success, data displayed was from "news.html". The error log showed
that "/news.html/" was not found in the case of the 404s.

Apache+mod_perl
---------------
/news.html      /news   /news/  /news.html/
200             200     200     200

200 means success, data displayed was from "news.html", error_log recorded
"/var/www/html/news.html" in all cases as the value of $r->filename (thanks
to my little Perl module logging this value for me). In the cases of
"/news/" and "/news.html/", my relative image links broke (for hopefully
obvious reasons).

Is this expected behavior? Why? I would expect Apache and Apache+mod_perl to
behave similarly. Am I missing something obvious? (Probably...)

Thanks,
Kris

P.S. Just for kicks, I tried a similar set of four URLs at stonehenge.com,
and they all displayed the same data (of course, I don't run that server, I
just happen to read Randal Schwartz's columns...):

http://www.stonehenge.com/perltraining/instructors.html
http://www.stonehenge.com/perltraining/instructors
http://www.stonehenge.com/perltraining/instructor/
http://www.stonehenge.com/perltraining/instructors.html/


-- 
kristopher nelson


Reply via email to