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 --------------------------

Reply via email to