I am looking to rewrite an incoming url request on TomCat with the Tuckey rewriter:
<rule>
<from>/OutputFile?sourceArticleId=([0-9]+)</from>
<to>/app/clipping/get/$1</to>
</rule>
the "?" question mark fails the regexp pattern matching. How can I properly escape it or what is the correct solution for this?
Best Answer
I' m not too familiar with reg exp in urlrewrite but you can try:
In many languages, the escaping character is the
\
Update:
According to the doc, by default, the query string is not included in the
<from>
element. So you can try with theuse-query-string
set in theurlrewrite
Also make sure that the
default-match-type
in the<urlrewrite>
is set toregex
(I use the Spring MVC template from STS and it is set towildcard
by default