You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jamie Krasnoo <jk...@socal.rr.com> on 2001/06/14 11:14:15 UTC
Best way to attach a module to /
What is the best way to attach a module to be run when a user first enters
the site?
use LocationMatch and set it to only match / as in ^/$ ?
Thanks,
Jamie Krasnoo
jkrasnoo@socal.rr.com
Re: Best way to attach a module to /
Posted by Thomas Klausner <do...@zsi.at>.
Hi!
On 14 Jun 2001, at 14:03, Andrew Ho wrote:
> JK>What is the best way to attach a module to be run when a user first
> JK>enters the site?
> GED>Can you be a bit more specific?
> I think the question is better phrased by the subject, "how can I
> use mod_perl to handle all requests?"
> ..
This works also:
<Location />
SetHandler perl-script
PerlHandler My::Module
</Location>
I think you can use this to "unset" mod_perl:
(I've seen it on the list but didn't try it ..)
<Location /images/>
SetHandler default
</Location>
--
D_omm
O_xyderkes http://domm.zsi.at
M_echanen
M_asteuei
Re: Best way to attach a module to /
Posted by Andrew Ho <an...@tellme.com>.
Hello,
JK>What is the best way to attach a module to be run when a user first
JK>enters the site?
GED>Can you be a bit more specific?
I think the question is better phrased by the subject, "how can I
use mod_perl to handle all requests?"
This is less intuitive than the much more easily understandable "how can I
use mod_perl to handle a request for a certain URL?" In the latter case
you can use Apache::Registry (and associate it with LocationMatch or
FilesMatch or whatever) or an explicit handler. In the former case, it's
not as obvious.
One solution is to use a PerlTransHandler with a dispatch table in it. The
PerlTransHandler will be called on all requests, and you can inspect
$r->uri to see if you want to handle it. Return DECLINED if it's not
something you're interested in handling (say a /images URL); otherwise,
handle the request right away, internally redirect to another handler, or
just directly add the handlers you want down the chain.
Hope that helps--
Humbly,
Andrew
----------------------------------------------------------------------
Andrew Ho http://www.tellme.com/ andrew@tellme.com
Engineer info@tellme.com Voice 650-930-9062
Tellme Networks, Inc. 1-800-555-TELL Fax 650-930-9101
----------------------------------------------------------------------
Re: Best way to attach a module to /
Posted by Ged Haywood <ge...@www2.jubileegroup.co.uk>.
Hi there,
On Thu, 14 Jun 2001, Jamie Krasnoo wrote:
> What is the best way to attach a module to be run when a user first
> enters the site?
Can you be a bit more specific?
73,
Ged.