Use a mod_perl transhandler for this, it's the phase of the
apache process that's responsible for matching the URI/request to a
file that'll be executed in the response phase.

http://perl.apache.org/guide/snippets.html#PerlTransHandler_example

        -sc

On Mon, Mar 19, 2001 at 07:42:14PM -0800, Paul Evad wrote:
> Delivered-To: [EMAIL PROTECTED]
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> Precedence: bulk
> list-help: <mailto:[EMAIL PROTECTED]>
> list-unsubscribe: <mailto:[EMAIL PROTECTED]>
> list-post: <mailto:[EMAIL PROTECTED]>
> Delivered-To: mailing list [EMAIL PROTECTED]
> X-Sender: [EMAIL PROTECTED]
> Date: Mon, 19 Mar 2001 19:42:14 -0800
> To: [EMAIL PROTECTED]
> From: Paul Evad <[EMAIL PROTECTED]>
> Subject: [OT?] %ENV question, mod_rewrite vs. mod_perl?
> X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
> 
> I'm new to mod_perl, so please bear with me a bit. I'm digging 
> through as much information as I can find and have a few questions.
> 
> I've used mod_rewrite for a lot of URI re-mapping solutions, but this 
> particular job I'm doing is a bit of a challenge.
> 
> I have an existing perl script (non mod_perl) which checks against a 
> number of ENV variables to determine which 'file' the browser should 
> see.
> 
> Trouble is, that script reads the file and spits it out to the 
> browser, which makes it useless for anything with SSI or PHP based 
> solutions.
> 
> My logic had me thinking that I could use mod_rewrite to query the 
> script, and rewrite the URI slightly according to what that script 
> spit back. Then apache could fill the request and SSI and PHP stuff 
> would remain intact (and be parsed).
> 
> So I wind up with
> 
> RewriteEngine on
> RewriteLogLevel 9
> RewriteLog  /home/httpd/logs/rewrite.log
> RewriteMap    foo       prg:/home/httpd/cgi-bin/foo.cgi
> RewriteRule   ^/(.+\.(html|htm|php|php3))$ /${foo:$1} [L]
> 
> which basically says, pass the URI to foo and give back a rewritten 
> URI, then go fetch it.
> 
> trouble is, due to the way the Map works, the foo.cgi is launched 
> then 'stays' launched, and from what I can tell has no access to the 
> %ENV variables that it would normally have available if it was run as 
> a normal cgi script.
> 
> So, this lead me to mod_perl. Is mod_perl a solution in this case?
> 
> If so, would it be a total replacement for the RewriteEngine in this example?
> 
> Is there a mod_perl script/module that already does URI rewriting 
> that I can use for reference?
> 
> Or,
> 
> Does anyone know how I could possibly make the %ENV available to 
> foo.cgi in a case like the above?
> 
> Thanks for any and all pointers.... if answering with ROTFM, please 
> point me to a URL or chapter ;-)
> 
> - Paul
> -- 
> 
> --------------------- Kudosnet Technologies Inc. ---------------------
> Support: [EMAIL PROTECTED]
> Accounts: [EMAIL PROTECTED]
> Sales: [EMAIL PROTECTED]
> ---------------------------- 1-877-885-8367 --------------------------

-- 
Sean Chittenden                [EMAIL PROTECTED]

PGP signature

Reply via email to