Re: Fw: Apache::ReadConfig and RewriteRule

Torsten Förtsch <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
On Tuesday, November 30, 2010 13:59:13 Mithun Bhattacharya wrote:
> I am trying to setup some rules using Apache::ReadConfig (to setup 
> Apache config using mod_perl) and was wondering how am I supposed to 
> define the RewriteCond and RewriteRule entries. 
> 
> I would like to implement something similar to the following inside a
> VirtualHost.
> 
> RewriteEngine on
> RewriteRule ^/$ /frontpage [R=permanent]
> RewriteCond '%{HTTP_USER_AGENT} "MSIE 7.0; Windows NT 6.1"
> RewriteRule ^(.*)$ http://pbcweb:8089$1 [L]
> 
> Primarily the issue I am facing is to figure out how to associate the 
> RewriteCond with the RewriteRule. I can create an array of arrayref to 
> enable all the RewriteRule though I am not sure where the RewriteCond for a
> particular RewriteRule would fit. I am assuming they will be some sort of
> array of hash refs but I  couldn't find any example of how these arrays
> are to be structured.
> 
> I would be appreciate it if someone could point me in the right direction.

The only thing I can answer here is ${r|s}->add_config excepts a list of 
strings. You can concatenate these strings in mind and think of that file as 
being included in httpd.conf.

That means you can even write

$s->add_config([
    '<Location /fritz>',
      'SetHandler server-status',
    '</Location>',
  ]);

Similarly it should be possible to add those 4 lines you mentioned. But that 
is for modperl2. Apache::ReadConfig smells of modperl1.

Torsten Förtsch

-- 
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.