URL rewrite of images/hrefs - Not working on the context?

7 views
Skip to first unread message

Salman Rizvi

unread,
Dec 8, 2009, 11:34:55 AM12/8/09
to UrlRewrite
Hello all,

I am using tuckey 2.6 -

I have the following images and hrefs included in my file:

So the page url is: http://localhost:7001/project/mc/aboutus/default.jsf

With the context root being: project

These are some images and hrefs included:

<img src="/cpo/mr/assets/images/banners/en/literacy2_C_en.jpg" ... />

<a href="/cpo/mc/aboutus/community/olympics/index.jsf" ... />

I want to flip the context in these urls to redirect to the page's
context root: project


So I've tried various configurations but cannot acheive success here
is some of what I have used:

<rule>
<from>/cpo/(.*)</from>
<to type="redirect">%{context-path}/$1</to>
</rule>

or

<rule>
<from>^/cpo/(.*)</from>
<to type="redirect">%{context-path}/$1</to>
</rule>

or

<rule>
<from>/cpo/mr/(.*)</from>
<to type="redirect">%{context-path}/mr/$1</to>
</rule>
<rule>
<from>/cpo/mc/(.*)</from>
<to type="redirect">%{context-path}/mc/$1</to>
</rule>

Does anyone know how I can acheive this?

Thanks!


Reply all
Reply to author
Forward
0 new messages