Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking to rewrite an incoming url request on TomCat with the Tuckey rewriter:


the "?" question mark fails the regexp pattern matching. How can I properly escape it or what is the correct solution for this?

share|improve this question
up vote 2 down vote accepted

I' m not too familiar with reg exp in urlrewrite but you can try:


In many languages, the escaping character is the \


According to the doc, by default, the query string is not included in the <from> element. So you can try with the use-query-string set in the urlrewrite

Also make sure that the default-match-type in the <urlrewrite> is set to regex (I use the Spring MVC template from STS and it is set to wildcard by default

<urlrewrite use-query-string="true">
<rule match-type="regex">
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.