Fw: Apache::ReadConfig and RewriteRule

--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 <inzoik [at] yahoo.com>
To: "modperl [at] perl.apache.org" <modperl [at] 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

<html><body><div style="font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div><span>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 ?<br></span></div><div><br><br><br>- Mithun<br></div><div style="font-size: 10pt; font-family: Courier New,courier,monaco,monospace,sans-serif;"><br><div style="font-size: 12pt; font-family: times new roman,new york,times,serif;"><font face="Arial" size="2">----- Forwarded Message -----<br><b><span style="font-weight:bold;">From:</span></b> Mithun Bhattacharya <inzoik [at] yahoo.com><br><b><span style="font-weight: bold;">To:</span></b> "modperl [at] perl.apache.org" <modperl [at] perl.apache.org><br><b><span style="font-weight: bold;">Cc:</span></b> <
br><b><span style="font-weight: bold;">Sent:</span></b> Wednesday, November 24, 2010 3:15:56 PM<br><b><span style="font-weight: bold;">Subject:</span></b>
Apache::ReadConfig and RewriteRule<br></font><br>
<meta http-equiv="x-dns-prefetch-control" content="off"><div id="yiv88887173"><div style="font-size: 10pt; font-family: Courier New,courier,monaco,monospace,sans-serif;"><div style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 127); font-family: Courier New,courier,monaco,monospace,sans-serif;" class="yiv88887173doctext"><font face="arial, helvetica, sans-serif">
Hi,
</font><div><font face="arial, helvetica, sans-serif">
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.
</font></div><div><font face="arial, helvetica, sans-serif"><br>
</font></div><div style="font-size: 13.3333px; font-style: normal; font-family: Courier New,courier,monaco,monospace,sans-serif;"><font face="arial, helvetica, sans-serif">I would like to implement something similar to the following inside a VirtualHost.</font><br></div><pre style="font-family: monospace;" class="yiv88887173code"><div style="font-family: monospace;" class="yiv88887173codeblock"><font face="arial, helvetica, sans-serif"><span style="font-family: arial,helvetica,sans-serif;" class="yiv88887173codetext"><font size="-1"><font style="color:rgb(0, 0, 0);" face="Courier New, courier, monaco, monospace, sans-serif">RewriteEngine on<br>RewriteRule ^/$ /frontpage [R=permanent]<br>RewriteCond '%{HTTP_USER_AGENT} "MSIE 7.0; Windows NT 6.1"<br>RewriteRule ^(.*)$ http://pbcweb:8089$1 [L
]</font><br></font></span></font></div><font face="arial, helvetica, sans-serif" size="-1"><br></font></pre><font face="arial, helvetica, sans-serif">


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.
</font><div><font face="arial, helvetica, sans-serif"><br></font></div><div style="color: rgb(0, 0, 127); font-size: 13.3333px; background-color: transparent; font-style: normal; font-family: arial,helvetica,sans-serif;"><font face="arial, helvetica, sans-serif">
I would be appreciate it if someone could point me in the right direction.
</font></div><div><font face="arial, helvetica, sans-serif"><br>


</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div style="font-size: 13.3333px; font-style: normal; font-family: Courier New,courier,monaco,monospace,sans-serif;"><font face="arial, helvetica, sans-serif">- Mithun</font></div>
</div><font style="background-color:rgb(255, 255, 255);color:rgb(0, 0, 127);" face="arial, helvetica, sans-serif">
</font></div>

</div></div></div></div><br>

</body></html>
--0-356210664-1291121953=:36335--
Mithun Bhattacharya [ Di, 30 November 2010 13:59 ] [ ID #2051049 ]

Re: Fw: Apache::ReadConfig and RewriteRule

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=3Dpermanent]
> 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 a=
s
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 tha=
t
is for modperl2. Apache::ReadConfig smells of modperl1.

Torsten Förtsch

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

Like fantasy? http://kabatinte.net
torsten.foertsch [ Di, 30 November 2010 14:19 ] [ ID #2051050 ]
Webserver » gmane.comp.apache.mod-perl » Fw: Apache::ReadConfig and RewriteRule

Vorheriges Thema: Re: Fw: Apache2::ReadConfig and RewriteRule
Nächstes Thema: Apache CMS running latest apreq candidate