matching end of url

1 view
Skip to first unread message

osbert...@yahoo.com

unread,
Jul 4, 2008, 3:15:17 PM7/4/08
to UrlRewrite
In my application, my styles are in /images and css in /css

because of the many redirects and urlrewrites, it is difficult to
anticipate the url structure. I want to know how I can catch all urls
that contain /images/ and just forward it. this is what i am writing
but it is not working

<rule match-type="wildcard">
<from>/(.*)/images/(.*)</from>
<to type="redirect" last="true">/images/$2</to>
</rule>

<rule match-type="wildcard">
<from>^/images/*</from>
<to last="true">/images/$1</to>
</rule>

i want to catch urls like http://localhost:6060/lalpac/images/but_1.jpg
and

http://localhost:6060/lalpac/pr/lk/images/but_1.jpg

daniel@calgoo

unread,
Jul 8, 2008, 11:51:02 AM7/8/08
to UrlRewrite
I think I just did this. I only used one rule per css/image/js folder
though. See if this helps:

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

On Jul 4, 12:15 pm, "farouk.alhas...@googlemail.com"
<osbert252...@yahoo.com> wrote:
> In my application, my styles are in /images and css in /css
>
> because of the many redirects and urlrewrites, it is difficult to
> anticipate the url structure. I want to know how I can catch all urls
> that contain /images/ and just forward it. this is what i am writing
> but it is not working
>
> <rule match-type="wildcard">
> <from>/(.*)/images/(.*)</from>
> <to type="redirect" last="true">/images/$2</to>
> </rule>
>
> <rule match-type="wildcard">
> <from>^/images/*</from>
> <to last="true">/images/$1</to>
> </rule>
>
> i want to catch urls likehttp://localhost:6060/lalpac/images/but_1.jpg
> and
>
> http://localhost:6060/lalpac/pr/lk/images/but_1.jpg
Reply all
Reply to author
Forward
0 new messages