Fw: Apache::ReadConfig and RewriteRule

Fw: Apache::ReadConfig and RewriteRule

am 30.11.2010 13:59:13 von Mithun Bhattacharya

--0-356210664-1291121953=:36335
Content-Type: text/plain; charset=us-ascii

Maybe I asked too silly a question or I asked it incorrectly but I am hoping someone can point me in the right direction for this ?




- Mithun



----- Forwarded Message -----
From: Mithun Bhattacharya
To: "modperl@perl.apache.org"
Cc:
Sent: Wednesday, November 24, 2010 3:15:56 PM
Subject: Apache::ReadConfig and RewriteRule


Hi,
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.


- Mithun



--0-356210664-1291121953=:36335
Content-Type: text/html; charset=us-ascii

Maybe I asked too silly a question or I asked it incorrectly but I am hoping someone can point me in the right direction for this ?



- Mithun

----- Forwarded Message -----
From: Mithun Bhattacharya <inzoik@yahoo.com>
To: "modperl@perl.apache.org" <modperl@perl.apache.org>
Cc: <
br>Sent: Wednesday, November 24, 2010 3:15:56 PM
Subject:
Apache::ReadConfig and RewriteRule



Hi,

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.





- Mithun








--0-356210664-1291121953=:36335--

Re: Fw: Apache::ReadConfig and RewriteRule

am 30.11.2010 14:19:27 von torsten.foertsch

On Tuesday, November 30, 2010 13:59:13 Mithun Bhattacharya wrote:
> I am trying to setup some rules using Apache::ReadConfig (to setup=20
> Apache config using mod_perl) and was wondering how am I supposed to=20
> define the RewriteCond and RewriteRule entries.=20
>=20
> I would like to implement something similar to the following inside a
> VirtualHost.
>=20
> RewriteEngine on
> RewriteRule ^/$ /frontpage [R=3Dpermanent]
> RewriteCond '%{HTTP_USER_AGENT} "MSIE 7.0; Windows NT 6.1"
> RewriteRule ^(.*)$ http://pbcweb:8089$1 [L]
>=20
> Primarily the issue I am facing is to figure out how to associate the=20
> RewriteCond with the RewriteRule. I can create an array of arrayref to=20
> 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.
>=20
> 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=20
strings. You can concatenate these strings in mind and think of that file a=
s=20
being included in httpd.conf.

That means you can even write

$s->add_config([
'',
'SetHandler server-status',
'
',
]);

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

Torsten Förtsch

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

Like fantasy? http://kabatinte.net