Hi,

So you want to change:

   /foo/zz/yy/index.html?aaa=1&bbb=ABCDE&ccc=3
to:
   /foo/ABCDE/zz/yy/index.html?aaa=1&bbb=2&ccc=3

? From your first mail it looked like you wanted to replace the /zz/ with
/ABCDE/ - is that not the case?

Remember that when using the test tool that you don't want the "&" in
the reg exp - that's only when you're putting it into the config file. You
want to use: ^/foo/[a-zA-Z0-9]*/(.*)\?.*bbb=([a-zA-Z0-9]*)&?+.*?$

Pete

On 10/18/07, ros <[EMAIL PROTECTED]> wrote:
>
>
> Hi!
>
> I made this rule for test, but it looks like it can not match test url:
> /foo/zz/yy/index.html?aaa=1&bbb=ABCDE&ccc=3
>
>    <rule>
>        <!--
>            This will rewrite URL from:
>                /foo/zz/yy/index.html?aaa=1&bbb=ABCDE&ccc=3
>            to
>                /foo/ABCDE/zz/yy/index.html?aaa=1&bbb=2&ccc=3
>        -->
>        <condition type="parameter" name="processed" operator= "notequal"/>
>
> <from>^/foo/[a-zA-Z0-9]*/(.*)\?.*bbb=([a-zA-Z0-9]*)&amp;?+.*?$</from>
>        <to>/foo/$2/$1?processed=true</to>
>    </rule>
>
> Regards,
> ros
>
>
> Pete Gould wrote:
> >
> > You can use () to denote a capturing group the use $1, $2 etc in your
> > replacement string to substitue these values in. :)
> >
> > On 10/18/07, ros <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >> Hi Matt!
> >>
> >> I have a /static folder in webapp and want it contents to be localized,
> >> like:
> >> /en/... for english, /ru/... for russian etc.
> >>
> >> finaly this works for me:
> >>    <rule>
> >>        <from>^/foo/(.*)$</from>
> >>        <to
> >> type="forward">/static/foo/%{session-attribute:
> >> org.apache.struts2.action.LOCALE}/$1</to>
> >>    </rule>
> >>
> >> unfortunately I did not found how to get url parameter value of
> FROM  url
> >> and put in to the TO url.
> >>
> >> Do you know regex pattern for that?
> >>
> >> e.g. from url  /foo/index.html?aaa=1&bbb=2&ccc=3 get value of bbb
> >> parameter
> >> and compose to url like /foo/2/index.html?aaa=1&ccc=3
> >>
> >> Thanks!
> >>
> >> ros
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> mraible wrote:
> >> >
> >> > Are you trying to make things more dynamic or just rewrite this one
> >> > URL? If it's just this one, you should be able to put the raw values
> >> > in an escape any regex special characters - like \? for ?.
> >> >
> >> > Matt
> >> >
> >> > On 10/18/07, ros <[EMAIL PROTECTED]> wrote:
> >> >>
> >> >> Hi!
> >> >>
> >> >> What regular expression can be used to rewrite this URLs:
> >> >>
> >> >> from  /faq/LANG1/index.html?locale=LANG2   to
> >> >> /faq/LANG2/index.html?locale=LANG2
> >> >>
> >> >> from  /faq/LANG1/foo/index.html?locale=LANG2   to
> >> >> /faq/LANG2/foo/index.html?locale=LANG2
> >> >>
> >> >>
> >> >> Thanks!
> >> >> --
> >> >> View this message in context:
> >> >> http://www.nabble.com/urlrewrite-tf4646656s2369.html#a13273518
> >> >> Sent from the AppFuse - User mailing list archive at Nabble.com.
> >> >>
> >> >>
> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >> >>
> >> >>
> >> >
> >> >
> >> > --
> >> > http://raibledesigns.com
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> > For additional commands, e-mail: [EMAIL PROTECTED]
> >> >
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/urlrewrite-tf4646656s2369.html#a13277359
> >> Sent from the AppFuse - User mailing list archive at Nabble.com.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/urlrewrite-tf4646656s2369.html#a13277854
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to