[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: Transhandler? Redirect permanent?
From:       Tyler MacDonald <tyler () yi ! org>
Date:       2006-10-26 2:09:49
Message-ID: 20061026020948.GA29670 () yi ! org
[Download RAW message or body]

Will Fould <willfould@gmail.com> wrote:
> I've started testing a handler (configured at '/') that parses $r->uri and
> checks the object, doing a redirect accordingly, but this seems wasteful for
> every hit.
> I've thought about using the handler for only 404...
> 
> How can this most effeciently be handled using the virtual name?

	mod_perl is great if you want to make complex decisions to arrive at
the dynamic document in question, but if you just want to provide mappings
based on a simple key/value table, I strongly suggest you use mod_rewrite.
Here's a good starting point for that:

	http://httpd.apache.org/docs/2.2/rewrite/

	The advantage is that in most cases, you end up with 2 or 3 lines of
code inline in your httpd.conf to handle the problem, instead of the
mod_perl way of writing a separate .pm with a handler whose overhead is
going to be at least 10 lines before you even start coding.

	I use both extensively and together; mod_perl for the content,
authentication, etc... and mod_rewrite for traffic control.

	Cheers,
		Tyler

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic