----- Original Message -----
From: "Al Morgan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 23, 2001 10:11 PM
Subject: Loading Index.pl as the Root File


> I've been studying Slash to better understand mod_perl.  I think I
> understand everything that happens in the config file, except for this:
>
> <Location ~ "^/$">
>         SetHandler "perl-script"
>         PerlHandler Slash::Host::slashcode::rootHandler
> </Location>
>
> Apparently, whenever the user reqests the root document (normally
> index.html), it calls rootHandler, which redirects it to index.pl.  My
> question is:  What does the ~ "^/$" mean?  I don't quite understand how
> they are doing what they're doing.
>

The "^/$" is a regular expression, signifying that it wants to find the
location that matches "/" between the start and the end of the line. So
it'll match only your root location. Actually the regular expression is
unnecessary here, a <Location /> would have been enough.

Now concerning what it does: it intercepts all requests for the root
location (for example www.example.com/ ), and calls rootHandler, as you
said. I don't think the index.html part will ever be handled, as Slash
handles the whole request.

Now, I would gladly give you any pointers to a good regular expression
tutorial, but I don't have any. I am sure that if you search around a little
(perl.com or the apache documentation would seem like a good place to
start), you can easily find some nice information.

Per Einar Ellefsen
[EMAIL PROTECTED]


Reply via email to